Installing the PHP environment - spaceshiptrooper

Hello guys! This project has been taking too long because I am busy at times. I have decided to make videos instead of text based tutorials because the amount of characters in my older thread was way too much and this should also be easy to follow as well. So what I have decided is to just post all of the videos that I have recorded thus far to help guide people for now. I am currently in the process of doing the installation of PHP on RPM based system (centOS) and for some reason the wifi adapter just won’t get recognized. I might have to use Ethernet cable to get this installation done. However, I don’t have a 50 foot cable since my router is out in the living room. I’ll have to get one soon so I can finish this installation. I also have decided not to make videos for every single Linux distro because it will take too long due to the sheer amount of distros out there. This also includes Windows 8 (x32 and x64) and Windows 8.1 (x32 and x64) because I apparently don’t have the ISO files for them.

So, the main purpose of this project and thread is to show everyone how I install PHP on my local environment on Windows, Linux, and Mac. Do keep in mind that every single playlist that you will be seeing in this thread is the complete setup. This will be Apache, PHP, MySQL, PHPMyAdmin, SSL, a demonstration video to make sure you can connect to the database, and other optional installations depending on the operating system. Most of these operating systems, I will also post extra videos that may actually have problems without proper configurations. I will list them under the header EXTRA and give you a reason why those may have problems if you do not configure them correctly.


ERROR REPORTING/ COMMON QUESTIONS OR PROBLEMS


If you happen to ever get stuck or get an error, please explain in full detail. Explain what operating system you are using to install PHP on, what the exact error message says (you can also take a screenshot of the error to give us a better understanding), what you were installing or doing before the error occurred, and just a brief overview of what you wanted to install or get working.

A bad example is

I have an error message that keeps popping up.

Yes, but what does it say? What were you trying to do? Explain in full detail and it’ll make your life and mine so much easier. Just saying “it doesn’t work” doesn’t explain nothing to me. I need the exact error message and the exact problem so that I can figure out what is going on. This way, I don’t have to try to read your mind through the computer screen because I am not telepathic and cannot read your mind through the computer screen. Just use common sense and explain in full detail. Taking screenshots is also very helpful. I don’t mind looking at screenshots because I can then see what you are attempting to do and what the error message actually says.

A good example is

Hello,

I am trying to install PHPMyAdmin and it doesn't allow me to change the filename from config.inc.sample.php to config.inc.php. I am using Windows 7 x32 bit. The error message says

"You do not have permissions to modify this file"

I will attach a screenshot to illustrate the problem.

This is a good example of what I would like to see. Simply saying “it doesn’t work” tells me absolutely nothing about your problem at all and it will just make your life harder.


EDIT: If you are using cURL for anything, remember to add CURLOPT_SSL_VERIFYHOST and CURLOPT_SSL_VERIFYPEER in your curl_setopt settings or if you are using the curl_setopt_array, add those 2 in there. Then set them to either false or 0. The reason why we set them to false or 0 is because we are using Self-assigned Certificates. This means that the browser doesn’t trust our certificates because we created them ourselves. To get a “green” lock, you have to go through a certificate authority. It doesn’t really matter to us because we know that our certificates are safe since we’ve created them ourselves. So if you get a yellow warning checkmark or if Chrome gives you a red warning and says it’s not safe, it’s actually pretty safe. Just that we didn’t go through a certificate authority.

2 Likes

So for the Windows installation, it really doesn’t matter which version you have. For example, if the videos use Home Premium and you are currently using Pro edition, that doesn’t effect anything. Just ignore the edition version because you can install PHP on all different edition versions in the same exact way. So it really doesn’t matter.


Windows 7 x32 Bit



Windows 7 x64 Bit



Windows 10 x32 Bit



Windows 10 x64 Bit



EXTRA


cURL FOR x32 BIT


https://www.youtube.com/watch?v=fFtVUKW1ONI

So this video applies to all Windows versions that are x32 Bit. The video is done in Windows 7, but again it applies to all Windows version that are x32 Bit. The reason why this is under EXTRA is because if cURL is an optional feature. If you want to enable it, you will actually have to do more work on x32 Bit. This is because for some reason, cURL can’t be recognized in the php.ini file even though you may have enabled it. If you happen to start up the Apache Monitor, you will actually receive this error message

PHP Startup: Unable to load dynamic library 'php_curl.dll'

If you search the internet for a fix, most people will say that a fix is to copy and paste the files libssh2.dll, ssleay32.dll, libeay32.dll, and php_curl.dll into the Apache\bin folder, but that’s actually not the correct way of doing it. Other fixes may be putting the PHP\ext location in the PATH variable, but again this isn’t the correct way and it may not even work at all. So to fix this problem, the video will demonstrate the proper way of doing it.


UPGRADING PHP


https://www.youtube.com/watch?v=PoYODeFV9GQ

The video above is using Windows 7 x32 Bit, but this same process can be done exactly in the same way on all Windows versions and editions. Just remember to download the correct PHP for your Windows version. For instance, download the Thread Safe for x32 (x86) Bit if you are using a x32 (x86) Bit Windows operating system. Download the Thread Safe for x64 Bit if you are using an x64 Bit Windows operating system.

Remember to re-enable all of the extensions you may need when you upgrade PHP versions because the ones you download from the PHP website will come in default form.

Yosemite 10.10.5



El Capitan 10.11.6



Sierra 10.12.6



High Sierra 10.13.6



Mojave 10.14.1


https://www.youtube.com/playlist?list=PLj1Ut5Njs4XwJ3ywgCH6c57GTAqUuSnYv


EXTRA


ZipArchive


https://www.youtube.com/watch?v=PD1sZIlrqCs

So apparently the liip website said that the included extensions are

bcmath bz2 calendar Core ctype curl date dom dtrace ereg exif fileinfo filter ftp gd gettext hash iconv imap intl json ldap libxml mbstring mcrypt memcache memcached mhash mongodb odbc mysql mysqli mysqlnd OAuth odbc openssl pcntl pcre PDO pdo_dblib pdo_mysql pdo_pgsql pdo_sqlite pgsql Phar posix Reflection session shmop SimpleXML soap sockets solr SPL SQLite sqlite3 standard sysvmsg sysvsem sysvshm tidy tokenizer wddx xdebug xhprof xml xmlreader xmlrpc xmlwriter xsl zip zlib Xdebug

And near the end of that, you can see that it has zip and zlib as included extensions, but I believe it’s a lie. If zip was included then you can automatically use ZipArchive, but you actually can’t. If you tried to use ZipArchive, you will receive this error message.

Fatal error: Class 'ZipArchive' not found in

This is because zip actually isn’t included. I have tried to add extension=zip.so in the 99-liip-developer.ini file and the error message still continues so that means that zip actually doesn’t exist as an included extension. To fix this problem, we have to install zip via Pecl which means that we have to build it ourselves. Doing this process isn’t easy. We need a couple of things because zip has dependencies. We need to install Homebrew to install phpize, autoconf, and fix the old libzip in our Mac system. You may ask why we don’t just install Homebrew to install PHP from the beginning and that is because I don’t use Homebrew for PHP. The main purpose of using Homebrew during this stage is to install phpize and autoconf. Otherwise, we’d actually avoid Homebrew altogether since we are installing PHP via liip and no other process during our installation uses Homebrew.


UPGRADING PHP


https://www.youtube.com/watch?v=nVh136iqUF8

Remember to re-enable all of the extensions you may need when you upgrade PHP versions because the new 99-liip-developer.ini file doesn’t contain your old 99-liip-developer.ini configurations. This should include adding extension=zip.so to the 99-liip-developer.ini file as well if you are using ZipArchive.

So I have decided not to record any other Debian based systems because this same process can be done exactly in the same way on other Debian based system like Linux Mint, ElementaryOS, Zorin, CrunchBang, BunsenLabs, etc. I will try to finish the centOS installation and update this section for RPM based system. I won’t get into Arch Linux because that will take too much time and I haven’t really dabbled in it. I know that it uses Pacman as it’s package manager instead of the traditional apt-get so I’m not too familiar with the commands it entails. Nevertheless, I won’t be doing any Arch Linux demonstrations.


Debian based


Ubuntu 18.04



EXTRA


Debian Based


UPGRADING PHP


All we are really doing is uninstalling PHP and then re-installing PHP by the latest version number. Really though there is a more correct way and that’s just by doing a sudo apt-get -y update which should update any old PHP version to the latest minor version of that version. For instance, if we are using PHP 7.2.1 and the latest version for PHP 7.2 is PHP 7.2.14, just doing a sudo apt-get -y update should update our PHP version to PHP 7.2.14 without needing to uninstall PHP.

Though I didn’t want to wait until an update was available to demonstrate it so I decided to just uninstall PHP and upgrade it from PHP 7.2 to PHP 7.3. This process should be the same for all Debian based systems.

Remember to also re-install all extensions because we uninstalled all of the extensions when we uninstalled PHP.

I promised that I would do an RPM based installation and I will, I am just caught up in a lot of homework. Just letting everyone know that in the newer versions of PHP (7.3.3 I believe or maybe even earlier), you will most likely receive an error that says something like

Warning: preg_match(): JIT compilation failed: no more memory in ...

This is a known bug in 7.3. To temporarily dismiss this error, you will have to go into your php.ini file and either add or uncomment the line that reads

;pcre.jit=1

Replace that line with

pcre.jit=0

If your php.ini file doesn’t have pcre.jit, then just add it in and set it to 0. Save it and restart your Apache server based on the operating system you are using. That should temporarily omit that error message. For now, it is a known bug and I’m pretty sure the PHP team knows about it.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.