Linux: apache2 do not load php...

Discussion in 'Computer Software and Operating Systems' started by mariogamer, May 5, 2016.

  1. mariogamer
    OP

    mariogamer GBAtemp Advanced Fan

    Member
    830
    229
    Aug 12, 2015
    Canada
    After installing php7,and running sudo service apache2 restart, php script do not load...

    For example,when returning php info:

    <?php
    phpinfo();
    ?>

    Firefox supply me to download the file...

    Any idea on how I can fix?
     
  2. Tomato Hentai

    Tomato Hentai baja boner blast

    Member
    3,783
    6,202
    Oct 30, 2014
    Canada
    actually north korea. please send help
  3. mariogamer
    OP

    mariogamer GBAtemp Advanced Fan

    Member
    830
    229
    Aug 12, 2015
    Canada
    Opening the file with my browser.

    Trying with localhost...

    — Posts automatically merged - Please don't double post! —

    Give me nothing at all...
     
  4. Tomato Hentai

    Tomato Hentai baja boner blast

    Member
    3,783
    6,202
    Oct 30, 2014
    Canada
    actually north korea. please send help
    Of course it's not gonna work if you drag and drop it. By doing that you're instructing the browser to open the file instead of requesting that apache renders the page then displays it.
     
  5. mariogamer
    OP

    mariogamer GBAtemp Advanced Fan

    Member
    830
    229
    Aug 12, 2015
    Canada
    The page is white...
     
  6. mgrev

    mgrev Music Addict, Video Game Fanatic

    Member
    GBAtemp Patron
    mgrev is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    1,858
    2,227
    Apr 13, 2015
    Norway
    Under Tomato Hentai's stairs
    try using another browser. i had issues like this with firefox. iirc chrome worked
     
  7. mariogamer
    OP

    mariogamer GBAtemp Advanced Fan

    Member
    830
    229
    Aug 12, 2015
    Canada
    In fact,I want to use it with my wiiu for hosting exploit,BUT it's give me "Cannot load the page"
     
  8. Z-WolF

    Z-WolF Member

    Newcomer
    15
    9
    Dec 29, 2015
    Cote d'Ivoire
    more info would be appreciated:

    Distro
    apache2.conf
    how did you install php7?
     
    Tomato Hentai likes this.
  9. mariogamer
    OP

    mariogamer GBAtemp Advanced Fan

    Member
    830
    229
    Aug 12, 2015
    Canada
    Ubuntu 16.04
    sudo apt-get install php
    apache2.conf

    — Posts automatically merged - Please don't double post! —

    Maybe adding a line in apache2.conf... I'll try...
     
  10. FAST6191

    FAST6191 Techromancer

    pip Reporter
    23,713
    9,583
    Nov 21, 2005
    United Kingdom
    Does it work if you host a static HTML page or directly visit the php page? I have had a few installs default to different ways of interpreting things, one which might send PHP down the list.
    Find httpd.conf (I hope it has not changed in recent years) and then the DirectoryIndex thing within it, it should be fairly obvious from there how to change priorities for things. Otherwise yeah I am going to start looking at what you have installed, firewall issues.
     
  11. Z-WolF

    Z-WolF Member

    Newcomer
    15
    9
    Dec 29, 2015
    Cote d'Ivoire
    can you post the contents of /etc/apache2/mods-enabled and mods-available?
     
  12. mariogamer
    OP

    mariogamer GBAtemp Advanced Fan

    Member
    830
    229
    Aug 12, 2015
    Canada
    Static html?

    — Posts automatically merged - Please don't double post! —

    etc/apache2
     
  13. Z-WolF

    Z-WolF Member

    Newcomer
    15
    9
    Dec 29, 2015
    Cote d'Ivoire
    yeah, a file ending in .html inside your web folder like "index.html"

    normally:

    "/var/www/html/index.php" is the first thing you see when you put "http://localhost" in your browser.

    if you have a file there with a name that it is not "index.html" or "index.php" then you have to call it differently in your browser:

    http://localhost/filename.php
     
    Tomato Hentai likes this.
  14. mariogamer
    OP

    mariogamer GBAtemp Advanced Fan

    Member
    830
    229
    Aug 12, 2015
    Canada
    index.html work.
     
  15. Z-WolF

    Z-WolF Member

    Newcomer
    15
    9
    Dec 29, 2015
    Cote d'Ivoire
    please execute this command
    Code:
    php -v
    and post the result
    also execute this one
    Code:
    ls -lA /etc/apache2/mods*
    and post the result (is a long one)
     
  16. mariogamer
    OP

    mariogamer GBAtemp Advanced Fan

    Member
    830
    229
    Aug 12, 2015
    Canada
    PHP 7.0.4-7ubuntu2 (cli) ( NTS )
    Copyright (c) 1997-2016 The PHP Group
    Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies

    mods:

    modes

    Edit: I must leave,sorry...
     
    Last edited by mariogamer, May 5, 2016
  17. Z-WolF

    Z-WolF Member

    Newcomer
    15
    9
    Dec 29, 2015
    Cote d'Ivoire
    theres the problem, you have installed php7 (appears as php5 in the available ones) but you dont have it enabled.

    execute this:

    Code:
    sudo a2enmod php5
    and then
    Code:
    systemctl restart apache2
    that should fix it
     
    Tomato Hentai likes this.
  18. mariogamer
    OP

    mariogamer GBAtemp Advanced Fan

    Member
    830
    229
    Aug 12, 2015
    Canada
    Job for apache2.service failed because the control process exited with error code. See "systemctl status apache2.service" and "journalctl -xe" for details.
     
  19. Z-WolF

    Z-WolF Member

    Newcomer
    15
    9
    Dec 29, 2015
    Cote d'Ivoire
    and what does those 2 commands tell you?
     
  20. mariogamer
    OP

    mariogamer GBAtemp Advanced Fan

    Member
    830
    229
    Aug 12, 2015
    Canada
    Just said it.