Apache/php web page loading problem

Discussion in 'Server Operation' started by Kev King, Aug 7, 2008.

  1. Kev King

    Kev King New Member

    Running Debian etch server with apache2, php5 installed.

    Having problems loading web sites in localhost or external using ip address.

    Basically when I try to open the site the php script is displayed in the explorer window and not the site as it should be.

    Am I missing something in apache config file.

    Will try and post relevent log files if required.


    Have re-installed following the tut here the pefect setup-debian, and using php4/php5 with apache. But something always seems to be goig wrong.

    I think there might be something wrong with my /etc/apache2/apache2.conf file but I cant seem to figure out where to put the commands that are missing.

    There doesnt seem to be a Directory listing:

    DirectoryIndex index.html index.htm index.shtml index.cgi index.pl index.php index.php4 index.xhtml

    and these 2 too:

    AddHandler php-script .php4
    Action php-script /cgi-bin/php4

    Can some one please shed some light???

    Have attached my /etc/apache2/apache2.conf file for info
    Last edited: Aug 8, 2008
  2. falko

    falko Super Moderator ISPConfig Developer

    The PErfect Setup for Debian contains a chapter where PHP gets disabled globally (this is needed by ISPConfig). If you don't use ISPConfig, please undo that chapter.
  3. Kev King

    Kev King New Member

    What a bloody plonker, I thought I had skipped that bit because I wasnt going to be installing ISPconfig. Just goes to show when you are concentrating so hard you dont always read the instructions properly.

    Just spent nearly the whole week trying to figure that problem out, un-installing and re-installing software, going round and round in circles.

    Just gettin an internal server error now, so am getting somewhere. Will re-install the apache bit of the tut.

    Once again many thanks falko, its easy when you know what your doing!!!
  4. Kev King

    Kev King New Member

    Extra question

    Would it do any harm to remove the files I have installed relating to apache and php? As I cant fully remember what I have tinkered with. And do a clean install of that part of the tutorial?

    apt-get remove ................... should do the trick right?
  5. falko

    falko Super Moderator ISPConfig Developer

    I'd use
    apt-get remove --purge ...
    to also remove the config files that came with the packages.
  6. Kev King

    Kev King New Member

    Um, still not able to view some web pages, it just displays the .php script.

    falko thanks for the above tip, done that a re-installed apache and php, followed the instructions in the tutorial without the ISPconfig bit.

    Is there something still that I have not installed or set up.

    The default apache test page displays ok

    Following extract that I have had a look at from PHP FAQ:

    I have followed all the steps to install the Apache module version on Unix, and my PHP scripts show up in my browser or I am being asked to save the file.

    This means that the PHP module is not getting invoked for some reason. Three things to check before asking for further help:

    Make sure that the httpd binary you are running is the actual new httpd binary you just built. To do this, try running: /path/to/binary/httpd -l If you don't see mod_php4.c listed then you are not running the right binary. Find and install the correct binary.
    Make sure you have added the correct Mime Type to one of your Apache .conf files. It should be: AddType application/x-httpd-php .php Also make sure that this AddType line is not hidden away inside a <Virtualhost> or <Directory> block which would prevent it from applying to the location of your test script.
    Finally, the default location of the Apache configuration files changed between Apache 1.2 and Apache 1.3. You should check to make sure that the configuration file you are adding the AddType line to is actually being read. You can put an obvious syntax error into your httpd.conf file or some other obvious change that will tell you if the file is being read correctly.

    mod_php4.c is not listed but I am at a loss as to were to find it or what will install it? enable it.

    Everything is installed as it should be from the tutorial.

    When I run php -i it displays alot of code so I am taking it that php is ok it must be something to do with apache?
  7. Kev King

    Kev King New Member

    Problem Solved

    Um, the problem was the naming of a file or its .xxx

    The file I was trying to access was not saved in the right format, now it has been it loads in explorer window fine.

    Let that be a lesson to anyone, check what your doing, even if your following some one else's idiot proof quide. It's what you input that will ultimately work or not which ever the case maybe.

    Thx falko for your replies.

Share This Page