How to run PHP on Fedora

This post is next from my "web development series". The last one was about starting Apache web server on Fedora.

Of course, if you have successfully running Apache web server, you need more sophisticated programming or scripting language than HTML. You can choose ruby, python, perl, ...or my favourite PHP.

To install php on Fedora just type in your terminal:
$ sudo dnf install php -y


And that's all. Now just restart your Apache:
$ systemctl restart httpd


Let's try PHP. Create new file info.php in document root of your webserver (probably, /var/www/html/) with this content:
<?php 
    phpinfo();
?>


Then go to url: http://localhost/info.php and you should see...
PHPinfo page


If you see this page... woala PHP is working fine. Next time we will talk about databases.

Comments