Installing the PHP environment - spaceshiptrooper [Style]

Windows Part 8


Installing PHPMyAdmin


1.) So it seems like we are getting close to the end of this tutorial. You did great if you got up to this point and got everything working. I am proud of you. So we are basically going to download the PHPMyAdmin files and we’re basically going to do the same thing we did on Linux. So open up your favorite web browser if you don’t already have it opened and open up a new tab. Type in the address bar phpmyadmin.net.

2.) Once you are on the PHPMyAdmin website, there’s three green buttons at the top right. It should list Download 4.6.x.x, Try demo, and Donate. Click on Download 4.6.x.x where x.x are the version numbers. Yours might be different from mine and that’s okay. The current one we are using for this tutorial is 4.6.5.2. Yours might be an up-to-date version. That’s even better.

3.) When you click on the Download button, it’ll prompt you a modal box along with your download. Save the compressed file by clicking on the Ok button. This should be stored in your default Downloads directory. You can close out of this tab and other various tabs if you want. You don’t have to keep these tabs opened as they will most likely waste space. But if you want to follow along, that’s fine.

4.) Open File Explorer and browse to your Downloads directory. Again, you can use the Downloads history dropdown list if you really wanted to. It’s up to you.

5.) Once your Downloads directory is opened, browse into the PHPMyAdmin compressed file. The one for this tutorial is called phpMyAdmin-4.6.5.2-all-languages.zip. Yours might be different and that’s okay.

6.) Again, we’re going to extract this compressed file into our Downloads directory. So in the top menu, click on the Extract option and from the expanded menu, click on Extract All. Leave the extraction location as you see it. It’ll extract it to the Downloads directory.





7.) Once the extraction process is finished, rename the directory to PHPMyAdmin.

8.) Copy&paste or Cut&paste the PHPMyAdmin directory. Browse to your development environment and paste the PHPMyAdmin directory there. The development environment should be C:/dev/www or C:/ Drive > dev > www.


9.) Open up your favorite web browser and open up a new tab. Type in the address bar phpmyadmin.localhost.com. Input your root account password and username. My root username is root and the password is root.


10.) If you are able to log in and get to this page, that means everything is working fine. If you get an error, you’ll have to fix it. If the error says something along the lines of “connection refused” or “connection lost” or “no connection”, that means that the MySQL server isn’t running and it also could mean that during the installation process for MySQL, you didn’t fix the problem that kept persisting so the MySQL server was never properly installed. You should go back and uninstall the MySQL server. Then reinstall it. The MySQL server has to be up and running in order for you to actually have PHPMyAdmin working. So if you have it working, scroll down the page. There will be two things that are being complained about. You’ll want to correct these two things if you want to keep PHPMyAdmin working properly.


11.) The first message should usually be about not having a phpMyAdmin table and what not. We’ll do this last because we’re still going to have to modify the configuration file which is what we also need in order to get rid of the blowfish_secret warning. So let’s do that. Open up File Explorer and browse to C:/dev/www/PHPMyAdmin or C:/ Drive > dev > www > PHPMyAdmin. Scroll down to where you can see the file config.sample.inc.php. Either create a copy of it or rename it to config.inc.php.



12.) Again, you can either drag and drop the file straight into the Text Editor from the current location or you can browse to it. C:/dev/www/PHPMyAdmin/ and then config.inc.php or C:/ Drive > dev > www > PHPMyAdminand thenconfig.inc.php`.


13.) Open up your favorite web browser again and open up a new tab. Type in your address bar google.com and search for the term phpmyadmin blowfish generator. It should be the first link that appears in the Google results. If you cannot find it, you can click on this link.

14.) You should be on the phpMyAdmin Blowfish Secret Generator page of question-defense.com. Scroll down about half way. You’ll see a randomly generated blowfish_secret text. Copy that and go back to your favorite Text Editor.


15.) With the blowfish_secret text copied, paste it in between the single quotes on the line that reads $cfg['blowfish_secret'] = ''; So you should have a random text in between = '';.

16.) Now, scroll down to line #47. That line should read // $cfg['Servers'][$i]['pmadb'] = 'phpmyadmin'; Uncomment it and every line until line #67. That should be the end point of things that you are required to uncomment in this file.



17.) Again, open up your favorite web browser if it isn’t already opened and open a new tab. This time, go to google.com and search for the term phpmyadmin examples/create_tables.sql. By default, the new PHPMyAdmin libraries do not provide the examples directory that we need in order for us to get PHPMyAdmin working. Older versions of PHPMyAdmin should contain this directory, but we can still find it on the web. The first link should be the correct one. It’s stored on a github repository.

18.) Once you’re on the github repository, click on the Raw button at the far right middle of the page. This will give us the raw file that we need. Right-click on a blank part of the page and from the context menu, click on Select All and copy it.


19.) If you haven’t closed out of the PHPMyAdmin tab yet. Browse back to it. If you already have, it’s fine. Just open a new tab and type in the address bar phpmyadmin.localhost.com. Once you’re on the home page of phpmyadmin.localhost.com, click on the SQL tab at the top. This will load up an SQL terminal where you can run SQL queries. It doesn’t really matter which page you are on, at least it’s a SQL tab. Now paste all the information you just copied from the github repository and click on the Go button at the lower right hand corner. Wait for a bit for the query to run and you should get something that looks like the second picture below.


20.) Once you are finished with the SQL tab, click on the Databases tab on the left of the SQL tab. We’re just going to create a test database to make sure that we can connect to MySQL and have PHP running on Apache. So just type test into the text field and click on the Create button.

21.) Browse into the test table if you aren’t already by default. You can also just click on the test link at the left sidebar. That will also browse you into the test table as well.

22.) In the text field in the Create table section, type in users with a column of 2 and hit the Go button.

23.) In the first column; specify id as the name, int type, with a length/value of 11, set id to primary key, and set it to auto_increment. For the second column; specify name as the name, text type, and you should normally set the Default value to NULL, but for tutorial purposes, we’re just going to save time. Once you are done with that, scroll down and at the bottom right hand corner, hit the Save button. It should lead you back to the Structure tab.


24.) Browse out of the users column by clicking on the test table at the left sidebar. This will bring you back to the test table. This time, click on the SQL tab.

25.) You can input anything you’d like for the name. For this tutorial, we’re going to just use three random names. spaceshiptrooper, Admin, and Demo. So in the text area, type in INSERT INTO users VALUES(1, 'spaceshiptrooper');. Then do the same with the other 2 demo names. We’re just doing this to make sure we can actually connect and display data from the database. Once you are done, click on the Go button to make changes.



26.) You can use the snippet that I provide in the introduction post if you’d like or you can create your own and test it.

27.) If all works, you should be able to display data like the below picture. If it didn’t work and you get a PHP error, remember. Go to C:/dev/logs/error.log to find out why. Sometimes error logs aren’t captured. You might need to do some research if the error halts, but aren’t being displayed and error logs are turned on.

3 Likes