1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice

How do I upgrade to PHP 5

Discussion in 'Plesk for Linux - 8.x and Older' started by chillnet, May 8, 2005.

  1. chillnet

    chillnet Guest

    0
     
    How do I upgrade to PHP5 when using Plesk. We've installed and compiled PHP5 but as soon as we integrate this with the Plesk interface the server doesn't parse any PHP pages anymore. If we start the server and take out all the Plesk configuration file includes the server starts up and works fine. Your help in this regard would be highly appreciated due to the fact that all our development is done in PHP 5.
     
  2. Daracne

    Daracne Guest

    0
     
    I'm also having the same problem as above. I'm compiling PHP5 from the SRPM in the fedora development branch.
     
  3. Cranky

    Cranky Guest

    0
     
  4. Daracne

    Daracne Guest

    0
     
    The plesk interface still works fine after installing the RPM packages I just built. However, on client sites, any PHP scripts will prompt the user to download the file, instead of parsing it.

    Also, thank you for the link to that page. However I'm trying to install PHP5 as an apache module, not CGI. I'm trying to replace PHP4 with PHP5, not run both at the same time.
     
  5. Daracne

    Daracne Guest

    0
     
    Bump... Just wanted to see if anyone has any ideas on why this is happening.
     
  6. gunter

    gunter Guest

    0
     
    This is because when you are using php5, you have to write "<IfModule mod_php5.c>" instead of "<IfModule sapi_apache2.c>".

    But I don't know how to fix this because plesk overwrite the config files all the time.

    Has anybody an idea?

    Gunter
     
  7. gunter

    gunter Guest

    0
     
    Ok, I solved the problem. It's not very nice, but it's working now.

    You have to edit two files in the php-source:

    sapi/apache2handler/sapi_apache2.c:
    add just before the last comment
    PHP:
    AP_MODULE_DECLARE_DATA module php5_module = {
            
    STANDARD20_MODULE_STUFF,
            
    create_php_config,              /* create per-directory config structure */
            
    merge_php_config,               /* merge per-directory config structures */
            
    NULL,                                   /* create per-server config structure */
            
    NULL,                                   /* merge per-server config structures */
            
    php_dir_cmds,                   /* command apr_table_t */
            
    php_ap2_register_hook   /* register hooks */
    };

    and remove the same declaration in file sapi/apache2handler/mod_php5.c


    After this changes you can compile php as needed and it's working with Plesk 7.5.3. I hope this will help some of you.
    I'm not responsible for any damage that could happen because of this change.

    Additional explaination:
    this patch will load PHP as Module "sapi_apache2.c" instead of "mod_php5.c" into Apache.

    Gunter
     
  8. AplosMedia

    AplosMedia Guest

    0
     
    Did you do a source compile, or using RPMs?

    This is my first time on plesk, and honestly, i've never done anything using RPM's and I am a little confused.

    - Eric
     
  9. gunter

    gunter Guest

    0
     
    I did a source compile, otherwise I couldn't change the source

    But I think you can use src.rpm's as well

    Gunter
     
  10. AplosMedia

    AplosMedia Guest

    0
     
    has anything else been messed up? When my server was first setup there were all kinds of errors with using the updater and php failing it's deps..

    So the steps I would need is:

    Get my msql version installed..
    Build PHP from sourcecode
    Rebuild Apache/HTTPD

    is that correct? and can the apache/httpd be done by rpm?

    Thanks,
    Eric
     
  11. gunter

    gunter Guest

    0
     
    if you have plesk 7.5.3 installed you should have everything needed for php5

    the way, I did:
    - download sources of php to /usr/local/src/
    - extract them
    - go into created folder
    - run this command:
    PHP:
    ./configure --prefix=/usr/local --with-apxs2=/usr/sbin/apxs2-prefork --with-mysql --enable-sockets --with-libxml --with-zlib --with-gd2 --with-regex=php --with-config-file-path=/etc/php5 --enable-memory-limit --with-layout=GNU --enable-inline-optimization --enable-magic-quotes --enable-safe-mode --enable-sigchild --with-openssl --with-imap --with-imap-ssl --enable-bcmath --with-bz2 --enable-calendar --with-curl --enable-dba --enable-exif --enable-ftp --with-gd --with-gettext --with-gmp --with-ldap --enable-mbstring --with-mcrypt --with-mhash --with-mime-magic --with-pgsql --enable-shmop --with-snmp --enable-wddx --with-xsl --enable-yp --with-jpeg-dir --with-ttf' --with-freetype-dir --with-t1lib=/usr/local --with-unixODBC
    that's all one command, so write it in one line (if you use this command you will have to install a lot of libraries, too. But configure will tell you...)
    - make
    - make install (this will not replace your existing php4 installation because it should be in "/usr")

    add the correct LoadModule-command, in case of Suse, you have to edit "/etc/sysconfig/apache2" replace "php4" by "php5" everywhere in the file (should be 3)

    - "cp /etc/php.ini /etc/php5/php.ini"
    - restart your apachen by "/etc/init.d/apache2 restart"

    that's all

    Gunter
     
  12. AplosMedia

    AplosMedia Guest

    0
     
    I am running 7.5.3, but before I attempt this...


    /usr/sbin/apxs2-prefork doesn't exist... infact, i don't have an apxs2 anywhere in /sbin that I can find... is this ok?

    - Eric
     
  13. AplosMedia

    AplosMedia Guest

    0
     
    I do have a:

    /usr/local/psa/admin/bin/apxs
     
  14. gunter

    gunter Guest

    0
     
    if you are using apache2 you should have an apxs2 anywhere. It don't has to be apxs2-prefork, it can also be only apxs2.

    best to do is to look into phpinfo() of the old php version
     
  15. gunter

    gunter Guest

    0
     
    no, not the one in /usr/local/psa it's the one of plesk itself. Don't touch this.
     
  16. AplosMedia

    AplosMedia Guest

    0
     
    I installed httpd-devel and now I have/usr/sbin/apxs

    Still no apxs2 though...
     
  17. gunter

    gunter Guest

    0
     
    then try to install apache2-devel. What distribution are you using?
     
  18. AplosMedia

    AplosMedia Guest

    0
     
    Redhat 3 ES...
     
  19. gunter

    gunter Guest

    0
     
    I never used Redhat, so I don't know how these packages are called. But as I wrote before, If you have apache2 you should get apxs2 somehow.
    Search for a howto on setting up apache2 and php in redhat...
     
  20. AplosMedia

    AplosMedia Guest

    0
     
    hehe... i think i have the proper apxs file right now, BUT

    im getting the following:


    checking for MySQL UNIX socket location... /var/lib/mysql/mysql.sock
    checking for mysql_close in -lmysqlclient... no
    checking for mysql_error in -lmysqlclient... no
    configure: error: mysql configure failed. Please check config.log for more information.
     
Loading...