Tuesday 18 July 2006 12:33:13 pm
Hi whatever whatever. I'm adding a short recipe on installing Apache and PHP on a Windows Machine.
1. Download PHP 4.3.11 binary package (http://www.php.net/get/php-4.3.11-Win32.zip/from/a/mirror)
2. Unzip the package in the root of your c:\ drive, and rename the folder to php (you should now have a folder named c:\php) 3. Copy all files in dlls and sapi folders to the root of your php folder
4. Rename php.ini-recommended to php.ini
(Here you must change some settings in php.ini to enable GD2, to extend timout and
change some memory limits.)
1. set extension_dir to extension_dir = "c:\php\extensions"
2. Remove the semicolon from extension=php_gd2.dll and extension=php_mbstring.dll
3. Set max_execution_time = 120
4. Set max_input_time = 60 5. Set memory_limit = 256M
5. Right click on My Computer and choose properties. Go to the Advanced tab.
Choose Environment Variables. In your PATH variable, add c:\php to the end (there should be a semicolon before c:\php)
6. Add a new variable called PHPRC, and set the value to c:\php. You have now told the OS where to find the php.ini file. 7. Reboot. You have now installed PHP.
8. Download and install Apache 1.3.35 (http://archive.apache.org/dist/httpd/binaries/win32/apache_1.3.35-win32-x86-src.msi)
9. Edit your httpd.conf file (You will find this in the directory where you installed Apache in, under the folder "conf"
1. Add <i>LoadModule php4_module "C:/php/php4apache.dll"</i> under the rest of
<i>Load Module</i> commands.
2. Add <i>AddModule mod_php4.c</i> under the rest of <i>Add module</i>
commands.
3. Under the line <i>DirectoryIndex index.html</i>, add <i>DirectoryIndex index.php</i>
This tells Apache that index.php are a default documenttype.
4. Under <b>Document types.</b>, add <i>
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps </i> between the <i>
<IfModule mod_mime.c></i> tag (i.e above <i>AddType application/x-tar .tgz</i>
5. Save your httpd.conf file, and restart apache. (This can be done from "services"
window. Right click My Computer, choose Manage. Expand <i>"Services and
Applications"</i>, and choose Services. Choose Apache, right click (if 2000), and choose Restart. If XP or 2003, choose restart on the left hand of the service name. 10. Your Apache service should now say Apache/1.3.35 (win32) PHP/4.3.11, and you're done! Hope this helps you out installing Apache and PHP. Regarding MySQL, I recommend downloading MySQL 5.0.11 (http://dev.mysql.com/get/Downloads/MySQL-5.0/mysql-5.0.22-win32.zip/from/http://mysql.borsen.dk/) and MySQL GUI tools (http://dev.mysql.com/downloads/gui-tools/index.html). Both are msi installers, and GUI setup, no ini configuration needed. Just remember to mark "use old passwords" under Startup Variables/Security in MySQL Admin, and clear all passwords of your users in this application. Save changes, restart server, log in as root with blank password, and change passwords again. Otherwise PHP 4.3.11 won't connect with your SQL server! Good luck, any questions, feel free to ask! Regards Vidar
|