Tuesday, October 21, 2008

How to Install PHP 5 on Windows XP

1 Download the install file from the PHP website. A link to this site is located in the resources section of this article.
Step2
Make a directory on your computer for PHP 5 . Open the folder you want to want to save the directory in. Right-click in the open window. Click "New Folder." Name the folder "PHP" or "php5." For example "c:\php5." Substitute your directory for "c:\php5" whenever it appears in this article.
Step3
Locate and move the files from the sub directory Windows created for PHP in Step1 to the directory created in Step 2. Windows normally places the files in "php-5.x.x-Win32." To move the files, click "Edit" and then click "Select All." To copy the files, right-click and choose "Copy" or hold down the "Ctrl" key and the "C" key at the same time. Open your new directory, c:\php5. Hold down the "Ctrl" key and the "V" key at the same time or right-click and choose "Paste."
Step4
Find the file "php.ini-recommended" in the directory. Open the file in Notepad. Replace the following if they are not correct. Look for "error_reporting" and change it to "error_reporting = E_ALL & ~E_NOTICE." If your scripts don't work as intended, locate "register_globals" and change it to "register_globals = On." Find "register_argc_argv" and change it to "register_argc_argv = On." If your scripts pass information in strings like index.php?var1=value1&var2=value2, replace "doc_root" with the path to your Apache web directory. For example, "doc_root = C:\Apache2\htdocs." Find 'extension_dir"' and change it to 'extension_dir = "C:\php5\ext".' The SMTP line needs to read "SMTP = smtp.yourISP.com."
Step5
Save the edited file in the PHP 5 directory. For example, save as "php.ini" in "c:php5."

No comments: