# installing php to our apache server Well, were doing PHP because the primary interactor with the community learning 2 lesson plan, is a ancient relic. HAHA. If you want to learn how to put something else on your server meet me in the community learning room and reference this post and ill try to point you in the right direction if I feel im knowledgeable enough to assist you. PHP. this should be simple enough. <br> `sudo apt install php libapache2-mod-php php-mysql -y` Cool. Thats going to take a few if your internet is anything like mine. To make sure it is working head over to your website directory and make a new test.php file. If you havent skipped any lessons you will know that the location im referencing is /var/www/html/*path here* and that you make a new file with touch *name here*. put in your php code or use mine ``` <?php phpinfo(); ?> ``` Check your website and see if its outputs anything. You should get a general overview of your current config. Feel free to delete this file once you have confirmed its working as it does contain potentially sensitive info if you included the above snippet. Now, as im not a php guy i was unaware that most php devs are detrimentally disabled without their gui of choice. :P of course imma poke fun oki: `sudo apt install phpmyadmin -y` When this installer is running it will ask information about the system that it is being installed onto. just like when setting up the secure mariadb use the arrow keys to navigate and space to check the box. We want to select apache2. If it ask for a password setup i recommend using the same one. This password is for the login on the phpmyadmin page that is created. Now php needs to have access to the db so we need to give it full permissions. start a sql session with `sudo mysql` then paste ``` GRANT SHOW DATABASES ON *.* TO 'phpmyadmin'@'localhost'; GRANT ALL PRIVILEGES ON *.* TO 'phpmyadmin'@'localhost'; GRANT SHOW DATABASES ON *.* TO 'phpmyadmin'@'%'; GRANT ALL PRIVILEGES ON *.* TO 'phpmyadmin'@'%'; FLUSH PRIVILEGES; ``` Exit the sql session. Now depending on your setup, you may only want phpmyadmin to be reachable from within your home network. If you want this to accessible from outside skip this step. head to `/etc/phpmyadmin/apache.conf` and add a line at the bottom that says: `Require ip 192.168.0.0` Your ip might be different. On my setup i have a router downstream from another router and they behave independent of one another (with the exception that the downstream still has to head upstream to reach wan). This means that my subnet will be `192.168.1.0`. Replace it with whatever yours is. Any device connecting from the internet will have a public ip rather then an internal one. For example 147.79.72.23 is the current ip of Chat-to.dev at the time of writing. phpmyadmin will filter request to the site/phpmyadmin if it is from anywhere other then from your home, aka, if its anything but a 192.168.x.x ip. Restart the server now. Your server should now be finished. Next lesson we will go over changing your routers settings to enable the rest of the internet to visit your site.
The articles are sensational and very clear as far as I can see. As they are organized, I don't believe there is anyone who doesn't understand them. I have to stop my work to finish part [3](https://chat-to.dev/post?id=910)
no rush. do your work first