jinzo avatar

Configure PHP 5 after installing with Apache on windows

jinzo

Published: 04 Jan 2018 › Updated: 04 Jan 2018Configure PHP 5 after installing with Apache on windows

Configure PHP 5 after installing with Apache on windows

php-logo.png

In this tutorial I'm going to explain how to configure PHP5 after installing with Apache and finish the and successfully finish installation with Apache.

Please Stop apache service if linked to php5 before proceed.

PHP 5

First make sure the version as it's very important. (Thread Safe)
Package Name:
php-5.6.32-Win32-VC11-x64.zip

Sketch.png

Rename:

php.ini-development to php.ini

Sketch.png

Edit php.ini (I'm going to use Notepad++ for example)
Sketch.png

Uncomment ; extension_dir = "ext" by removing ;

Then replace ext with your ext folder path in windows. you will find it inside php folder.

Now Enable some important extensions

;extension=php_mysql.dll (if you're using it)
;extension=php_mysqli.dll
;extension=php_mbstring.dll
;extension=php_pdo_mysql.dll

If you want to access your MySQL database from PHP 5, you'll need to enable extensions that allow you to do so, like php_mysqli or php_pdo_mysql. (Both Recommend)

Sketch.png

Just Uncomment it. remove ; and it will be enabled.

Composer (optional)

Composer is a tool for dependency management in PHP, like a package manager. It allows to easily install PHP packages and even entire frameworks.

Composer requires the PHP OpenSSL extension to be enabled, so let's enable it in C:\php5\php.ini for example.

Use your text editor's search function to search for php_openssl.dll, there should already be a commented line for it, just uncomment that line.
Sketch.png

Now download Composer's Windows installer:
Download Page or Direct link

Follow the instructions, when prompted for the path to PHP, browse to C:\php5 and select php.exe.

That's it, Composer is now installed system-wide and can be used from anywhere - you can try it out, just open a new command prompt and type composer.

Now create new file in your htdocs to test our configuration.
for example that path in Apache:
C:\Apache24\htdocs

Create new file info.php
Sketch.png

Add this to the file:

 <?php phpinfo() ?> 

Open it from your browser for example:
http://localhost/info.php

Sketch.png

Mysqli Support
Sketch.png

PDO
Sketch1.png

Previous tutorials:
Setup your own Apache MariaDB PHP phpMyAdmin on Windows!
How to use multiple PHP versions with Apache on Windows

Image Credits:
All Screenshots taken by @Jinzo
Post Intro a free design available on the web licensed for public usage for php an open source web language.



Posted on Utopian.io - Rewarding Open Source Contributors

Leave Configure PHP 5 after installing with Apache on windows to:

Written by

Read more #utopian-io posts


Best Posts From jinzo

We have not curated any of jinzo's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.

More Posts From jinzo