Doubt with PHP and Apache

Asked

Viewed 143 times

8

I formatted my machine and was advised to use Linux, and I did so. But in my localhost, the files .php are not read/recognized, only files .html.

I installed, reinstalled and did everything I saw on the Internet, but to no avail.

  • 3

    Was the php module set up in apache? Describe the procedures you ran, tbm leave the links you consulted.

  • 1

    What linux are you using and how was the installation? Did you follow any specific tutorial?

  • The problem is in the configuration of your server, because if php is not running, it is because you have not configured it correctly. There is no way to predict what you have done and can help. I vote that your question be closed.

  • I installed the Lamp, I saw a procedure on the Internet, I believe it is basically the same procedure, I kind of followed this tutorial (http://blog.wfsneto.com.br/2011/12/17/config-configurar-ambient-development-php-no-ubuntu-11-10).

  • In the terminal I used a $ sudo nano /etc/apache2/sites-enable/000-default.conf and changed the apache folder. And I created a php.info file by the terminal and it worked. but when I create another file by Sublime for example.. it doesn’t work.

3 answers

5

I advise to follow a tutorial for configuration of PHP, Apache and Mysql (if you want) on linux. You have this tutorial from Digital Ocean, that I always use when I need.

3

If you are using Ubuntu or derivative you could use the command below where you leave your Lamp 100% functional:

sudo apt-get install lamp-server^
  • I had already installed Lamp

  • 1

    @Albi Lamp is not the Lamp application and rather means Linux Apache Mysql Php (aka LAMP), it installs each one separately and makes all their integration much easier.

  • Yes, I had seen that term and went to see what it meant. I meant that I did the "procedure".

  • 1

    is that there is a LAMP application https://bitnami.com/stack/lamp a complete package nothing else but using the command I passed is more practical and more optimized. @Albi

0


I solved it. My problem was with permissions, I gave a "$ sudo chmod 777 /var/www" on the terminal and it worked!

  • If you have solved, mark your own answer as the solution

Browser other questions tagged

You are not signed in. Login or sign up in order to post.