PHP installation and setup
In order to start development with php you need three components
- Database (I prefer Mysql)
- Web server (I prefer Apache)
- PHP interpreter
I assume you are using MS Windows for your development.
First download and install MySql from MySql 5.0 downloads
Next download and install Apache from Apache 2.2 downloads
Next download and unzip php to say c: from PHP 5.2 download
Some additional steps
- Copy php.ini-recommended as php.ini in your PHP installation directory
- In new php.ini file update the properties extension_dir = “c:\php\ext\” (I assume that you extracted php to c:\php folder – if it is different update your correct path)
- In new php.ini file enable extension=php_pdo.dll extension=php_sqlite.dll extension=php_mysql.dll extension=php_pdo_mysql.dll
- Edit httpd.conf file under conf folder of Apache installation, add the following lines at the end of the file
AddType application/x-httpd-php .php
LoadModule php5_module “c:\php\php5apache2_2.dll”
SetEnv PHPRC C:\php\
Thats it your dev environment is ready. Start the Apache server.
Write a simple file called as test.php with the following content
<?php echo ‘Welcome to php’; ?>
and save it as test.php under the folder htdocs of your apache installation folder.
From you web browser access the file as http://localhost/test.php
You should see the result as Welcome to php
Continue with next lesson Variables & operators










hi
I am getting the error of http.conf as one of the module, i.e.
LoadModule php5_module “c:\php\php5apache2_2.dll”
seems not loading….
and its throwing syntex error for the line:
Invalid LoadModule path \x93c:\\php\\php5apache2_2.dll\x94
Its working now:
the second line need to edit, and it should be like
LoadModule php5_module c:\php\php5apache2_2.dll, instead of..
AddType application/x-httpd-php .php
LoadModule php5_module “c:\php\php5apache2_2.dll”
SetEnv PHPRC C:\php\
Leave your response!
About
Check my other blog at:
Subscribe
Get this Wordpress newsletter widget
for newsletter software
User menu
Pages
Categories
Blogroll
Recent Posts