Configuring apache server and Install PHP on apache server

Configuring apache server and install PHP on apache server.

First you need to download php from php.net
We use php 7 version when we made this tutorial, because that was latest version of php.
Our php version is 7.2.17.

After download php, extract it from zip and then rename it into php7 
to make easier when connect to apache server. Move it into C:\\Program Files.




Before we start to install and configure php, we need to configure some apache server settings.

Go to your apache folder and then open folder conf :



And then open httpd.conf, don't forget to turn off your apache server if it running to avoid file cannot be edit.

First go to ServerName and uncomment and then change the value to localhost :



After change the value of ServerName go to <IfModule mime_module> on httpd.conf and paste this code on line before </IfModule> :


And then go to last line of httpd.conf and paste this code to connect php.ini to apache server




Now we will install php on apache server.

Open folder php7 and look for php.ini-development




Rename it into php.ini and find doc_root and fill it according on your apache server location.




Uncomment extension_dir and fill it according on folder ext location on php7




Go to file upload and uncomment upload_tmp_dir and then fill it with apache's directory upload path.



Go to Fopen wrappers and then change allow_url_include from off to on.

Now go Dynamic Extensions and here you must uncomment these extension to make your php run correctly :
- extension=curl
- extension=gd2
- extension=mbstring
- extension=exif
- extension=mysqli
- extension=openssl
- extension=pdo_mysql
- extension=xmlrpc
- extension=xsl
Uncomment session.save_path and then fill with your apache session folder location. 
This process allow you to store your session when you need to use session, whether for login, or store another session.




Turn on your apache server ON and then create file phpinfo.php like this : 

And save it into folder htdocs (on server apache).



Open your browser and type http://127.0.0.1/phpinfo.php on url address bar, and it will shown :

Now you has finished tutorial how to install and configure php on apache server, on next article 
we will show you how to install and configure mysql database and phpmyadmin.

Comments

Buy me a coffeeBuy me a coffee