php files not showing properly (as text)

Discussion in 'Server Operation' started by pimvh, Oct 3, 2006.

  1. pimvh

    pimvh New Member

    php files showing not properly.

    Installing ubuntu ans ISPconfig all seems to be ok the install was right out the box (with the help file)
    But there is a little problem.
    After set php in ispconfig the files do not showing properly, in fact they are showing up as ordinary text files in the browser.

    Wat goes here wrong?
     
  2. Ben

    Ben HowtoForge Supporter

    Sounds like the php interpreter module is not correctly installed on the apache serving you websites.

    What happens if you run
    aptitude install libapache2-mod-php4
    In case of you have apache2 running?
     
  3. pimvh

    pimvh New Member

    Hi, thanks for your quick response.


    root@server1:~# aptitude install libapache2-mod-php4 Reading package lists... Done
    Building dependency tree... Done
    Reading extended state information
    Initializing package states... Done
    The following packages have been kept back:
    linux-image-k7 linux-restricted-modules-k7
    0 packages upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
    Need to get 0B of archives. After unpacking 0B will be used.
    Writing extended state information... Done
    Reading package lists... Done
    Building dependency tree... Done
    Reading extended state information
    Initializing package states... Done
    root@server1:~#

    After restarting ispconfig nothing changed. :confused:


     
  4. TheRudy

    TheRudy ISPConfig Developer

    Did you actualy install php? ISPConfig uses its own apache/php..

    If you installed php, did you enable it in apache config file?
     
  5. pimvh

    pimvh New Member

    I do exactly what was in the help file `The Perfect Setup - Fedora Core 4`
    It runs without any problem compiled without any error.

    Make a new Reseller in ispconfig, a client, and a site enable everything.
    Upload the files (in the right dir) with FTP and everything seems to be ok except showing php.

    Where do I enable php in the Apache config file?
     
  6. pimvh

    pimvh New Member

    Mistake its not Fedora but Ubuntu I'm installing!!!!
    So I used of course also the ISP-Server Setup - Ubuntu 5.10 "Breezy Badger" guide and not the Fedora!

    I see that several people having the same error but I'm found no solution.


     
  7. pimvh

    pimvh New Member

    Found something...
    In /etc/apache2/mods-enabled/php4.conf

    Changed this:

    <IfModule mod_php4.c>
    # AddType application/x-httpd-php .php .phtml .php3
    # AddType application/x-httpd-php-source .phps
    </IfModule>

    In this:

    <IfModule mod_php4.c>
    AddType application/x-httpd-php .php .phtml .php3
    AddType application/x-httpd-php-source .phps
    </IfModule>

    And php seems to run now.

    But the helpfile says; "comment out these lines" :confused:
     
  8. TheRudy

    TheRudy ISPConfig Developer

    If you uncomment those PHP will work for every site you have on your server even if you disable PHP in ISPConfig.

    Check the apache vhost file (can't remember the name) and see if you have php definition in there for a domain.
     
  9. pimvh

    pimvh New Member

    I'm not sure...is this ok?
    Change the domainname in IP adress I'm testing this with a server at home.


    # ISPConfig vHost Configuration File
    # Version 1.0
    #
    ###################################
    #
    NameVirtualHost 192.168.2.130:80
    <VirtualHost 192.168.2.130:80>
    ServerName localhost
    ServerAdmin root@localhost
    DocumentRoot /var/www/sharedip
    </VirtualHost>
    #
    #
    ######################################
    # Vhost: www.localdomain:80
    ######################################
    #
    #
    <VirtualHost 192.168.2.130:80>
    ServerName 192.168.2.130:80
    ServerAdmin webmaster@localdomain
    DocumentRoot /var/www/web1/web
    ServerAlias localdomain
    DirectoryIndex index.html index.htm index.php index.php5 index.php4 index.php3 index.shtml index.cgi index.pl index.j
    ScriptAlias /cgi-bin/ /var/www/web1/cgi-bin/
    AddHandler cgi-script .cgi
    AddHandler cgi-script .pl
    ErrorLog /var/www/web1/log/error.log
    AddType application/x-httpd-php .php .php3 .php4 .php5
    <Files *.php>
    SetOutputFilter PHP
    SetInputFilter PHP
    </Files>
    <Files *.php3>
    SetOutputFilter PHP
    SetInputFilter PHP
    </Files>
    <Files *.php4>
    SetOutputFilter PHP
    SetInputFilter PHP
    </Files>
     
  10. falko

    falko Super Moderator

    Have a look here: http://www.howtoforge.com/forums/showthread.php?t=2343&highlight=disable php globally
    http://www.howtoforge.com/forums/showthread.php?t=1461&highlight=disable php globally
     
  11. pimvh

    pimvh New Member

    I'ts not working.
    Can I test this without FQDN? with only IP addresses?
     
  12. falko

    falko Super Moderator

Share This Page