Removed yesterday VPS. Googled the manuals of basic settings, like everything set up. I created the phpinfo test folder in / var / www /, created index.php in it. But the trouble is, open http: // moydomen / phpinfo in the browser, instead of information, my non-compiled code from index.php opens in the browser. What can be problem? I suspect that I have missed something very important and obvious.

Ubuntu OS 14.04.5 LTS

PHP5

    3 answers 3

    1. What is the control panel on the VPS?
    2. Domain attached, DNS configured? In general, the domain must first show the stub on the main page.
    3. Judging by the description it seems that this user is simply not allowed to use PHP
    • 1. Configured via the PuTTY console 2. The domain is attached, the Ubuntu-Apache main page is displayed by domain. 3. Yes, in time settings, created a new user. It seems that all the rights of the root user passed to him. Can you please on this item for more details. - overtheman
    • one
      You can simply set the owner / group: chown -R www-data:www-data /var/www - Pikachu
    • I’m definitely not going to tell you, there’s not enough data, maybe there’s no web server at all on the server, not apache, not nginx. Webserver configurations for each host indicate the necessary settings - StupidSkynet

    Probably not installed or not connected to the web server PHP interpreter

    • And how can you check this for sure? - overtheman
    • Run the php -v server console - Aleksandr Balyunou
    • Information about the interpreter and its version should appear. You can install the module for Apache and enable it as follows: The module for Apache PHP as a module for Apache can be installed as follows: sudo apt-get install libapache2-mod-php5 You can enable the PHP 5 module in Apache: sudo a2enmod php5 - Aleksandr Balyunou nov
    • Yes, the version is displayed and displayed, But the code pkhp does not want to work - = (( - overtheman

    After two nights of pornography with the server, I still found the problem. As I expected, I missed the important and obvious. I have studied dozens of blogs and articles on this topic, but nowhere does it say about configuring apache2. As a result, the problem was solved by the created file in the folder with apache2 configs. I registered three lines there: the first is the name of the server, the second is to allow the use of php scripts (which was the problem), and the third is the default encoding UTF-8. After that php earned, as native.

    Everyone who tried to help, thanks!