Installing the PHP environment - spaceshiptrooper [Style]

Windows Part 5


Installing PHP


1.) Installing PHP itself on Windows takes around 7 steps to do because all we’re doing is using the binary files. There’s really nothing we need to do except configure the php.ini file and maybe copy over some files that maybe needed for cURL to work correctly on a x32 bit Operating System. So once you get to this step, we’re almost done. I’d say about half way to a little more than half way there. So about 3/4-ths done. Anyways, open up the File Explorer and browse to your PHP directory. It should be C:/dev/progs/PHP if you did it correctly during the Prepping your system section. Scroll down and rename php.ini-development. We’re going to only be using the development file since we are developing on a local machine. The production file is only for live servers. Both of them will vary and have different lines commented out and uncommented out. So rename php.ini-development to php.ini.



2.) Again, you can either open the php.ini file either by dragging and dropping the file into the Text Editor or you can browse to C:/dev/progs/PHP using your Text Editor.

3.) Once you have the php.ini file opened, hit CTRL+F to open up the Find command. Search for the term error_log. You might want to click on Find or Next until you find the line that reads ;error_log = php_errors.log. We’re basically looking for the error log and we’re going to add in our own error log which will be stored in C:/logs or C:/ Drive > logs.

4.) Just two lines below ;error_log = php_errors.log, you should have another line that reads ;error_log = syslog. You can either replace and uncomment this line or you can create a new line break and add in your own. It doesn’t matter. These lines are commented out, but we’re just going to leave them as default and create a new line break for our own error log. So once you have created a new line break, type in error_log = "C:\dev\logs\error.log". It needs to be the full path because these programs can’t read your mind. If you’re telling it to locate a specific location and you know where it is, you might want to use the full path as it will be helpful for the programs to determine where it is exactly that you want to point to. We are also naming our error log error.log.


5.) Again, in the search bar. Search for the term extension_dir. This time, we’re going to be searching for the extension directory section and we’re going to be adding in our own extension directory location. Once again, you might want to click on Find or Next until you find the line that reads ; extension_dir = "./". Again, after the commented section, type in extension_dir = "C:\dev\progs\PHP\ext".


6.) Next, search for the term .dll. There are only a selection of .dll lines so this one is easy to find. The first line you find should be ; extension=msql.dll. Scroll down a little bit and then uncomment the extensions that you really need. The ones that are really required for any basic PHP installations are php_curl.dll (only if you use cURL), php_gd2.dll (only if your project relies on the GD library for creating and modifying images), php_mbstring.dll (required for PHPMyAdmin to work), php_mysqli.dll (only if you are accustomed to MySQLi_*), php_pdo_mysql.dll (only if you are accustomed to PDO). php_openssl.dll isn’t really needed if you don’t know what it’s used for.



7.) Scroll down a little bit and you’ll find the timezone line. If you don’t want to put in your timezone. You don’t have to. You can skip this step if it doesn’t apply to you. If you do however want to put in your timezone, you’ll want to go to that link that’s in the comments. The link you want to really go to is http://php.net/manual/en/timezones.php. The link that’s in the comments only leads to you a page that has this link in there. You’ll have to have a sharp eye in order to see where the link is. But since I have it linked above, you can just click on that link. Copy&paste the nearest timezone to you. Mine is America/Chicago.


2 Likes