PHP version...

Discussion in 'Installation/Configuration' started by ctroyp, Oct 9, 2005.

Thread Status:
Not open for further replies.
  1. ctroyp

    ctroyp New Member HowtoForge Supporter

    I currently have PHP 5.0.5 installed for ISPConfig. I am running another application (phpBB2) on my server and it requires a version below 5.x. Does anyone see any issues on downgrading? Anything I need to be concerned with in ISPConfig?
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    ISPConfig works with PHP4 as well as with PHP5. I think you will not get any issues with ISPConfig.
     
  3. ctroyp

    ctroyp New Member HowtoForge Supporter

    When I remove the php 5.0.5 version, it is not going to remkove any shared files used by ISPConfig is it? Or, would it be better to just install the 4.x version over top?
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    There are no shared files, ISPConfig has its own PHP5 installation for the controlpanel backend so it is not affected by the change of the PHP installation for the websites.

    I recommend to first remove the PHP5 before installing PHP4.
     
  5. ctroyp

    ctroyp New Member HowtoForge Supporter

    I think I may have found an underlying problem...

    I was going to use the 'Add/Remove Applications' in the GNome desktop (since I am not that comfotable with the terminal yet). When I unchecked 'php' package and continued to 'Update' it came up with the following error:

    Unlocatable package:
    php
    Required by:
    ('php-pear', '5.0.5', '2.1')
    ('php-ldap', '5.0.5', '2.1')
    ('php-devel', '5.0.5', '2.1')
    ('php-gd', '5.0.5', '2.1')
    ('php-imap', '5.0.5', '2.1')
    ('php-mysql', '5.0.5', '2.1')
    ('php-odbc', '5.0.5', '2.1')
    ('php-xmlrpc', '5.0.5', '2.1')
     
  6. ctroyp

    ctroyp New Member HowtoForge Supporter

    I am still having issues on downgrading my PHP 5.0.5 version. So ISPConfig has its own instance of PHP5. With that in mind, I tried installing PHP 4.4.0 on my system, but the installation instructions on the PHP website directed me to install Apache 2 along with it. I wen on with the install and everything seemed okay.

    When I did:
    Code:
    php -v
    it replied with:
    Code:
    PHP 5.0.5 (cli) (built: Sep  8 2005 06:58:48)
    Copyright (c) 1997-2004 The PHP Group
    Zend Engine v2.0.5, Copyright (c) 1998-2004 Zend Technologies
    Now I am confused...shouldn't it be 4.4.0?

    Back to my original problem (PHPBB2 requires < PHP 5.x). When I am trying to install PHPBB2 for one of my ISPConfig sites, is there something special that I need to do to get it to use my PHP 4.4.0 version?

    Would it just be easier to downgrade my ISPConfig PHP instance to 4.4.0? What is involved in that?

    Thanks for any help you can offer...
     
  7. falko

    falko Super Moderator Howtoforge Staff

    Run
    Code:
    updatedb
    locate php
    to find out if you have more than one PHP installation (besides the ISPConfig PHP, of course). Maybe your PHP 4 saw that there is already a PHP 5 and chose to install itself somewhere else.

    :eek: No, because the ISPConfig PHP is not used by your main Apache. This is something completely different.
     
  8. ctroyp

    ctroyp New Member HowtoForge Supporter

    All I could find is 4.4.0?

    Shouldn't 5.0.5 show up somewhere?
     
  9. ctroyp

    ctroyp New Member HowtoForge Supporter

    If I am installing PHPBB2 for one of my ISPConfig hosted sites, the PHPBB2 directory needs to be located in the respective web directory of the site. Since ISPConfig uses PHP 5.0.5, won't PHPBB2 try and use it also?
     
  10. falko

    falko Super Moderator Howtoforge Staff

    No, because ISPConfig has its own Apache. There are two Apaches on your system: your main one running on port 80 (and maybe 443) which uses its own PHP, and the ISPConfig Apache on port 81 using another PHP. These two are totally independent of each other.
     
  11. ctroyp

    ctroyp New Member HowtoForge Supporter

    Okay, I think I know how to fix this now.

    One other thing...

    I noticed in my main instance of Apache, not the ISPConfig, that the following line is present:
    Code:
    Include /etc/httpd/conf/vhosts/Vhosts_ispconfig.conf
    I understand virtual hosts, but why does this line exist in my main Apache config file?

    Thank you VERY much for answering my questions Falko, you have been very helpful!
     
  12. falko

    falko Super Moderator Howtoforge Staff

    Because it's your main Apache that serves your virtual hosts. Don't let yourself irritate by the string ispconfig on the file name - that's just because it's the ISPConfig system which writes that file.
     
  13. ctroyp

    ctroyp New Member HowtoForge Supporter

    Now I have a problem with my sites linking to the wrong directory.

    In my main Apache config file is the following:
    Code:
    #
    # DocumentRoot: The directory out of which you will serve your
    # documents. By default, all requests are taken from this directory, but
    # symbolic links and aliases may be used to point to other locations.
    #
    DocumentRoot "/var/www/html"
    
    and:
    Code:
    #
    # This should be changed to whatever you set DocumentRoot to.
    #
    <Directory "/var/www/html">
    Is this correct? If not, what needs to be changed to direct my vhosts to the respective directories? /home/www/web1/web, etc...
     
  14. till

    till Super Moderator Staff Member ISPConfig Developer

    That is correct, the document root settings are not relevant for ISPConfig. ISPConfig writes the vhost settings in the file /etc/httpd/conf/vhosts/Vhosts_ispconfig.conf that is included at the end of the httpd.conf.
     
  15. ctroyp

    ctroyp New Member HowtoForge Supporter

    Well, I thought I had it figured out but I still cannot get the ISPConfig sites to route to the proper directories. I keep getting the main Apache (default) page for my sites.

    Everything looks correct in all of the config files. I don't know where to turn now.

    This is what is in the main Apache httpd.conf file (/etc/httpd/conf) for ISPConfig:
    Code:
    ###############ispconfig_log###############
    LogFormat "%v||||%b||||%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined_ispconfig
    CustomLog "|/root/ispconfig/cronolog --symlink=/var/log/httpd/ispconfig_access_log /var/log/httpd/ispconfig_access_log_%Y_%m_%d" combined_ispconfig
    
    <Directory /home/www/*/web>
        Options +Includes -Indexes
        AllowOverride None
        AllowOverride Indexes AuthConfig Limit FileInfo
        Order allow,deny
        Allow from all
        <Files ~ "^\.ht">
        Deny from all
        </Files>
    </Directory>
    
    <Directory /home/www/*/user/*/web>
        Options +Includes -Indexes
        AllowOverride None
        AllowOverride Indexes AuthConfig Limit FileInfo
        Order allow,deny
        Allow from all
        <Files ~ "^\.ht">
        Deny from all
        </Files>
    </Directory>
    
    <Directory /home/www/*/cgi-bin>
        Options ExecCGI -Indexes
        AllowOverride None
        AllowOverride Indexes AuthConfig Limit FileInfo
        Order allow,deny
        Allow from all
        <Files ~ "^\.ht">
        Deny from all
        </Files>
    </Directory>
    
    Include /etc/httpd/conf/vhosts/Vhosts_ispconfig.conf
    and the ISPConfig Vhosts_ispconfig.conf file (/etc/httpd/conf/vhosts):
    Code:
    ###################################
    #
    # ISPConfig vHost Configuration File
    #         Version 1.0
    #
    ###################################
    #
    NameVirtualHost 192.168.2.50:80
    NameVirtualHost 192.168.2.50:80
    #
    #
    ######################################
    # Vhost: www.mydomain1.com:80
    ######################################
    #
    #
    <VirtualHost 192.168.2.50:80>
    ServerName www.mydomain1.com:80
    ServerAdmin [email protected]
    DocumentRoot /home/www/web1/web
    ServerAlias mydomain1.com
    DirectoryIndex index.html index.htm index.php index.php5 index.php4 index.php3 index.shtml index.cgi index.pl index.jsp Default.htm default.htm
    ScriptAlias  /cgi-bin/ /home/www/web1/cgi-bin/
    AddHandler cgi-script .cgi
    AddHandler cgi-script .pl
    ErrorLog /home/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>
    <Files *.php5>
        SetOutputFilter PHP
        SetInputFilter PHP
    </Files>
    php_admin_flag safe_mode On
    php_admin_value open_basedir /home/www/web1/
    php_admin_value file_uploads 1
    php_admin_value upload_tmp_dir /home/www/web1/phptmp/
    php_admin_value session.save_path /home/www/web1/phptmp/
    AddType text/html .shtml
    AddOutputFilter INCLUDES .shtml
    Alias /error/ "/home/www/web1/web/error/"
    ErrorDocument 400 /error/invalidSyntax.html
    ErrorDocument 401 /error/authorizationRequired.html
    ErrorDocument 403 /error/forbidden.html
    ErrorDocument 404 /error/fileNotFound.html
    ErrorDocument 405 /error/methodNotAllowed.html
    ErrorDocument 500 /error/internalServerError.html
    ErrorDocument 503 /error/overloaded.html
    AliasMatch ^/~([^/]+)(/(.*))? /home/www/web1/user/$1/web/$3
    AliasMatch ^/users/([^/]+)(/(.*))? /home/www/web1/user/$1/web/$3
    </VirtualHost>
    #
    #
    #
    ######################################
    # Vhost: www.mydomain2.com:80
    ######################################
    #
    #
    <VirtualHost 192.168.2.50:80>
    ServerName www.mydomain2.com:80
    ServerAdmin [email protected]
    DocumentRoot /home/www/web2/web
    ServerAlias ftp.mydomain2.com mydomain2.com
    DirectoryIndex index.html index.htm index.php index.php5 index.php4 index.php3 index.shtml index.cgi index.pl index.jsp Default.htm default.htm
    ScriptAlias  /cgi-bin/ /home/www/web2/cgi-bin/
    AddHandler cgi-script .cgi
    AddHandler cgi-script .pl
    ErrorLog /home/www/web2/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>
    <Files *.php5>
        SetOutputFilter PHP
        SetInputFilter PHP
    </Files>
    php_admin_flag safe_mode On
    php_admin_value open_basedir /home/www/web2/
    php_admin_value file_uploads 1
    php_admin_value upload_tmp_dir /home/www/web2/phptmp/
    php_admin_value session.save_path /home/www/web2/phptmp/
    AddType text/html .shtml
    AddOutputFilter INCLUDES .shtml
    AddType application/vnd.wap.wmlscriptc .wmlsc .wsc
    AddType text/vnd.wap.wml .wml
    AddType text/vnd.wap.wmlscript .ws .wmlscript
    AddType image/vnd.wap.wbmp .wbmp
    Alias /error/ "/home/www/web2/web/error/"
    ErrorDocument 400 /error/invalidSyntax.html
    ErrorDocument 401 /error/authorizationRequired.html
    ErrorDocument 403 /error/forbidden.html
    ErrorDocument 404 /error/fileNotFound.html
    ErrorDocument 405 /error/methodNotAllowed.html
    ErrorDocument 500 /error/internalServerError.html
    ErrorDocument 503 /error/overloaded.html
    AliasMatch ^/~([^/]+)(/(.*))? /home/www/web2/user/$1/web/$3
    AliasMatch ^/users/([^/]+)(/(.*))? /home/www/web2/user/$1/web/$3
    RewriteEngine on
    RewriteCond %{HTTP_HOST}   ^ftp\.mydomain2\.com [NC]
    RewriteRule   ^/(.*)$  http://www.mydomain2.com/ftp/$1  [R]
    </VirtualHost>
    #
    #
    #
    Short of me having to reinstall everything, I thought I would post this info to see if you guys saw anything wrong. With this in mind, I can access my ISPConfig control panels, and FTP sites, etc.--just not the actual websites.

    Is there anything you see that is incorrect? If not, what else do I need to check to see why the websites will not show?

    THANKS!
     
  16. till

    till Super Moderator Staff Member ISPConfig Developer

    Are you sure your domain mydomain2.com resolves to the correct IP: 192.168.2.50?

    The vhosts are namebased, that means even if your domain resolves to an IP that is on the same server but it is not the IP in the vhost configuration you will see the apache main website!
     
  17. falko

    falko Super Moderator Howtoforge Staff

    Is it possible that you have Apache and Apache2 installed on your system, and Apache2 is the one that's running? Then maybe the ISPConfig configuration got written to Apache instead of Apache2 so that it has no effect...
     
  18. ctroyp

    ctroyp New Member HowtoForge Supporter

    To the best of my knowledge it is setup correctly. I have had these sites up and running correctly for a couple months now. It all changed when I installed Apache2 again with PHP4. I installed Apache2 and PHP4 in /usr/local/apache2 and PHP4 in /usr/local/apache2/lib/php-4.4.0. The problem is, when I installed this new instance of Apache, it wrote to my main (original) Apache config file somehow. It put in random start statements containing "apachectl start". I removed everything in my main config file to get it to match my original config, but it left me in the situation I am currently at. One other thing I did was I copied the PHP4 (libphp4.so) over to my modules directory of the main Apache and changed the main config file to "LoadModule php4_module modules/libphp4.so" instead of PHP5...

    I did stop the newly installed Apache service and restarted the main.

    To the best of my knowledge, this is all that I did.

    How do I confirm that my domains are being resolved properly?
     
  19. ctroyp

    ctroyp New Member HowtoForge Supporter

    In my last reply, I mentioned that I did install another instance of Apache2. This made it three instances of Apache2:
    • Main Apache2 in the /etc directory
    • ISPConfig Apache2, and
    • the new Apache2 that I installed with PHP4
     
  20. ctroyp

    ctroyp New Member HowtoForge Supporter

    I juust realized that I cannot access either domain site (even though they both route to the main apache index.html) from outside my network--I get The page cannot be displayed". I can at least access the something from inside my network.
     
Thread Status:
Not open for further replies.

Share This Page