0% found this document useful (0 votes)
21 views2 pages

Onfigurar PHP

The document provides instructions for installing PHP on a Windows system to work with Apache web server. It includes steps to create a PHP folder, extract PHP files, configure the php.ini file by enabling extensions and settings, add PHP to environment variables, configure Apache to load PHP modules and restart Apache. It concludes by providing a test to check the PHP installation by creating an index.php file with phpinfo() and accessing it via localhost.

Uploaded by

Marcelo Mijaria
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views2 pages

Onfigurar PHP

The document provides instructions for installing PHP on a Windows system to work with Apache web server. It includes steps to create a PHP folder, extract PHP files, configure the php.ini file by enabling extensions and settings, add PHP to environment variables, configure Apache to load PHP modules and restart Apache. It concludes by providing a test to check the PHP installation by creating an index.php file with phpinfo() and accessing it via localhost.

Uploaded by

Marcelo Mijaria
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

2. Create a folder PHP in your hard disk for PHP.

I strongly recommend using


C:/PHP.

3. Unzip all the files in the directory you created. The PHP folder will now
contain several other folders and about 30 files.

4. In the PHP folder, locate the file called php.ini-development. Make a copy of it
and rename the copy php.ini

Advertisements

REPORT THIS AD

5. Open the php.ini file with any text editor.

6. Configure the following:


Enable Short Open Tags
Search the line: short_open_tag = Off and change it to short_open_tag = On

Go to the Error Handling ang Logging Section and locate error_reporting = E_ALL &
~E_NOTICE and change it to error_reporting = E_ALL
This will ensure that your PHP is robust.

Go to the Path and Directories Section and locate extension_dir = �./� and change
it to extension_dir = �C:\php\ext\�
NOTE: Change the path to where you extracted the PHP files.

Go to the Dynamic Extensions Section. You will see a long list of titled Windows
Extensions. You can enable these extra features any time by removing the semicolon
from the beginning of the line for the extension you want. Here�s a list of
important extensions:

;extension=php_mbstring.dll

;extension=php_gd2.dll

;extension=php_mysql.dll and ;extension=php_mysqli.dll and add these two lines


extension=php_pdo.dll and extension=php_pdo_mysql.dll� for mySQL

;extension=php_pdo_pgsql.dll and ;extension=phppgsql.dll -for PostgreSQL

Go to the Module Setting Section. Edit only for Mail Function


Change SMTP = localhost to SMTP = smtp.yahoo.com
Note: Change smtp.example.com to your appropriate outgoing address. For instance,
your email address is [email protected], your outgoing address is probably
smtp.yahoo.com. Remove the semicolon from the beginning of the line
sendmail_from = then put the necessary email address.

Last, locate this line


;session.save_path = �/tmp�
Remove the semicolon from the beginning of the line and change the setting in
quotes to
session.save_path = �C:\Windows\Temp�

7. Save and close php.ini

Add PHP to your environment variables:


1. Open the Windows Contol Panel(Start -> Settings -> Control Panel). Double Click
the System icon. Select the Advanced tab and click Environment Variables
2. In the System Variables pane at the bottom of the dialog box, highlight Path and
click Edit

3. A smaller dialog box will open. Edit the Variable value field. Insert the path
where you placed your PHP folder. Click OK

4. Create a System Variable with variable name PHPRC. The variable value is the
path to your PHP folder.

5. Click OK to close all the dialog boxes.

Configure Apache to work with PHP


1. Locate and open the Apache configuration file httpd.conf using a script editor.
The file is located in C:\Program Files\Apache Software Foundation\Apache2.2\conf
(for Apache 2.2)

2. Find the list of items that being with LoadModule. At the end of the list, add
LoadModule php5_module �C:/php/php5apache2_2.dll� (for Apache 2.2)
LoadModule php5_module �C:/php/php5apache2.dll� (for Apache 2.0)

3. Locate this line


DirectoryIndex index.html and replace it with
DirectoryIndex index.html index.php

4. Find the AddType commands and add


AddType application/x-httpd-php .php

5. At the end of httpd.conf file add


PHPIniDir �C:/PHP� Note: Change path accordingly

Restart the Apache Web Server


How To Test Your PHP Installation:
1. Create a php file containing
<?php phpinfo(); ?>

2. Save the file as index.php. Place it in the htdocs folder located in your Apache
folder.(eg. C:\Program Files\Apache Software Foundation\Apache2.2\htdocs)

3. Open your web browser and type in the url http://localhost/index.php. If PHP
installation was successful, this would display all the information about your PHP
installation.

You might also like