John Davidson

apache2 - Why won't my php website display on localhost?

0 comments
Message:


I am very very new to php. I have a simple "test.php" file in my Documents/PHP/ directory. I go to "localhost/test.php" but I get a:


Not Found
The requested URL was not found on this server.

Apache/2.4.46 (Ubuntu) Server at localhost Port 80

I installed php using these commands:


sudo apt install php libapache2-mod-php

and


sudo systemctl restart apache2

here is the contents of my "test.php" file:


<?php 
phpinfo();
?>


My Answer:
Apache2 is a popular open-source web server software that is widely used to host websites and web applications. It is known for its reliability, scalability, and security features. The reason why Apache2 is so widely used is because it is easy to install and configure, has a large community of developers and users who provide support and updates, and is compatible with a wide range of operating systems and web technologies. Additionally, Apache2 is free to use, which makes it an attractive option for individuals and organizations looking to host their websites without incurring additional costs.

Rate this post

4 of 5 based on 6467 votes

Comments




© 2024 Hayatsk.info - Personal Blogs Platform. All Rights Reserved.
Create blog  |  Privacy Policy  |  Terms & Conditions  |  Contact Us