Results 1 to 8 of 8
  1. #1
    Join Date
    Jul 2007
    Posts
    68

    How to upgrade to PHP 5?

    Hi Friends,
    I have a linux VPS server.My trouble started when I bought a script that required me to install PHP5. Currently my server have 4.3.9.

    Being a linux noob, it took me 2 days to install PHP 5 but now the problem is everything is still using PHP 4.3.9. When i do a phpinfo(); it shows php4.3.9.So, can someone please tell me how to tell the system to use PHP 5.

    I used the exact same ./configure command as i see in the PHPINFO(); for PHP4.3.9 i.e
    Code:
    #'./configure' '--build=i686-redhat-linux-gnu' '--host=i686-redhat-linux-gnu' '--target=i386-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--cache-file=../config.cache' '--with-config-file-path=/etc' '--with-config-file-scan-dir=/etc/php.d' '--enable-force-cgi-redirect' '--disable-debug' '--enable-pic' '--disable-rpath' '--enable-inline-optimization' '--with-bz2' '--with-db4=/usr' '--with-curl' '--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr' '--with-png-dir=/usr' '--with-gd=shared' '--enable-gd-native-ttf' '--without-gdbm' '--with-gettext' '--with-ncurses=shared' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr' '--with-openssl' '--with-png' '--with-pspell' '--with-xml' '--with-expat-dir=/usr' '--with-dom=shared,/usr' '--with-dom-xslt=/usr' '--with-dom-exslt=/usr' '--with-xmlrpc=shared' '--with-pcre-regex=/usr' '--with-zlib' '--with-layout=GNU' '--enable-bcmath' '--enable-exif' '--enable-ftp' '--enable-magic-quotes' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-track-vars' '--enable-trans-sid' '--enable-yp' '--enable-wddx' '--with-pear=/usr/share/pear' '--with-imap=shared' '--with-imap-ssl' '--with-kerberos' '--with-ldap=shared' '--with-mysql=shared,/usr' '--with-pgsql=shared' '--with-snmp=shared,/usr' '--with-snmp=shared' '--enable-ucd-snmp-hack' '--with-unixODBC=shared,/usr' '--enable-memory-limit' '--enable-shmop' '--enable-calendar' '--enable-dbx' '--enable-dio' '--enable-mbstring=shared' '--enable-mbstr-enc-trans' '--enable-mbregex' '--with-mime-magic=/usr/share/file/magic.mime' '--with-apxs2=/usr/sbin/apxs'
    
    #make
    #make install
    Even the installed PHP seems not be working after the upgrade, when i type "php" i see this now:
    Code:
    # php -v
    PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php4/domxml.so' - /usr/lib/php4/domxml.so: undefined symbol: empty_string in Unknown on line 0
    PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php4/gd.so' - /usr/lib/php4/gd.so: undefined symbol: empty_string in Unknown on line 0
    PHP Warning:  PHP Startup: UWVS?: Unable to initialize module
    Module compiled with module API=20020429, debug=0, thread-safety=0
    PHP    compiled with module API=20060613, debug=0, thread-safety=0
    These options need to match
     in Unknown on line 0
    PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php4/ldap.so' - /usr/lib/php4/ldap.so: undefined symbol: empty_string in Unknown on line 0
    PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php4/mbstring.so' - /usr/lib/php4/mbstring.so: undefined symbol: empty_string in Unknown on line 0
    PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php4/mysql.so' - /usr/lib/php4/mysql.so: undefined symbol: empty_string in Unknown on line 0
    PHP Warning:  PHP Startup: UVS
    : Unable to initialize module
    Module compiled with module API=20020429, debug=0, thread-safety=0
    PHP    compiled with module API=20060613, debug=0, thread-safety=0
    These options need to match
     in Unknown on line 0
    PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php4/odbc.so' - /usr/lib/php4/odbc.so: undefined symbol: empty_string in Unknown on line 0
    PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php4/pgsql.so' - /usr/lib/php4/pgsql.so: undefined symbol: empty_string in Unknown on line 0
    PHP Warning:  PHP Startup: UVS): Unable to initialize module
    Module compiled with module API=20020429, debug=0, thread-safety=0
    PHP    compiled with module API=20060613, debug=0, thread-safety=0
    These options need to match
     in Unknown on line 0
    PHP Warning:  PHP Startup: US": Unable to initialize module
    Module compiled with module API=20020429, debug=0, thread-safety=0
    PHP    compiled with module API=20060613, debug=0, thread-safety=0
    These options need to match
     in Unknown on line 0
    PHP 5.2.5 (cli) (built: May  5 2008 23:38:38)
    Copyright (c) 1997-2007 The PHP Group
    Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
    [[email protected] php-5.2.5]# php
    PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php4/domxml.so' - /usr/lib/php4/domxml.so: undefined symbol: empty_string in Unknown on line 0
    PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php4/gd.so' - /usr/lib/php4/gd.so: undefined symbol: empty_string in Unknown on line 0
    PHP Warning:  PHP Startup: UWVS?: Unable to initialize module
    Module compiled with module API=20020429, debug=0, thread-safety=0
    PHP    compiled with module API=20060613, debug=0, thread-safety=0
    These options need to match
     in Unknown on line 0
    PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php4/ldap.so' - /usr/lib/php4/ldap.so: undefined symbol: empty_string in Unknown on line 0
    PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php4/mbstring.so' - /usr/lib/php4/mbstring.so: undefined symbol: empty_string in Unknown on line 0
    PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php4/mysql.so' - /usr/lib/php4/mysql.so: undefined symbol: empty_string in Unknown on line 0
    PHP Warning:  PHP Startup: UVS
    : Unable to initialize module
    Module compiled with module API=20020429, debug=0, thread-safety=0
    PHP    compiled with module API=20060613, debug=0, thread-safety=0
    These options need to match
     in Unknown on line 0
    PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php4/odbc.so' - /usr/lib/php4/odbc.so: undefined symbol: empty_string in Unknown on line 0
    PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php4/pgsql.so' - /usr/lib/php4/pgsql.so: undefined symbol: empty_string in Unknown on line 0
    PHP Warning:  PHP Startup: UVS): Unable to initialize module
    Module compiled with module API=20020429, debug=0, thread-safety=0
    PHP    compiled with module API=20060613, debug=0, thread-safety=0
    These options need to match
     in Unknown on line 0
    PHP Warning:  PHP Startup: US": Unable to initialize module
    Module compiled with module API=20020429, debug=0, thread-safety=0
    PHP    compiled with module API=20060613, debug=0, thread-safety=0
    These options need to match
     in Unknown on line 0
    Please help guys if you can ...

    Thanks

  2. #2
    Did you restart your apache service after your PHP upgrade?

    If not, try:

    /etc/init.d/httpd restart

    or

    /etc/init.d/apache restart
    ---=== RoseHosting.com Admin ===---
    Linux Cloud Hosting - linuxcloudvps.com
    Linux VPS Hosting - rosehosting.com
    High Quality Linux virtual servers with lots of Guaranteed RAM and HDD space, Impeccable Service.

  3. #3
    Join Date
    Feb 2004
    Location
    UK
    Posts
    1,429
    Hi

    Are you using Cpanel ?

    if so you could use easyapache to update PHP.

    Thanks

  4. #4
    Httpd restart have nothing to it, and also, as is see configure command, there is no cPanel...
    Recompile php again with command:
    #'./configure' '--build=i686-redhat-linux-gnu' '--host=i686-redhat-linux-gnu' '--target=i386-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--cache-file=../config.cache' '--with-config-file-path=/etc' '--with-config-file-scan-dir=/etc/php.d' '--enable-force-cgi-redirect' '--disable-debug' '--enable-pic' '--disable-rpath' '--enable-inline-optimization' '--with-bz2' '--with-db4=/usr' '--with-curl' '--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr' '--with-png-dir=/usr' '--with-gd=shared' '--enable-gd-native-ttf' '--without-gdbm' '--with-gettext' '--with-ncurses=shared' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr' '--with-openssl' '--with-png' '--with-pspell' '--with-xml' '--with-expat-dir=/usr' '--with-dom=shared,/usr' '--with-dom-xslt=/usr' '--with-dom-exslt=/usr' '--with-xmlrpc=shared' '--with-pcre-regex=/usr' '--with-zlib' '--with-layout=GNU' '--enable-bcmath' '--enable-exif' '--enable-ftp' '--enable-magic-quotes' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-track-vars' '--enable-trans-sid' '--enable-yp' '--enable-wddx' '--with-pear=/usr/share/pear' '--with-imap=shared' '--with-imap-ssl' '--with-kerberos' '--with-ldap=shared' '--with-mysql=shared,/usr' '--with-pgsql=shared' '--with-snmp=shared,/usr' '--with-snmp=shared' '--enable-ucd-snmp-hack' '--with-unixODBC=shared,/usr' '--enable-memory-limit' '--enable-shmop' '--enable-calendar' '--enable-dbx' '--enable-dio' '--enable-mbstring=shared' '--enable-mbstr-enc-trans' '--enable-mbregex' '--with-mime-magic=/usr/share/file/magic.mime' '--with-apxs2=/usr/sbin/apxs'

    and - this is important - cut -> ' this and all should be fine.

  5. #5
    Join Date
    Sep 2003
    Location
    Earth!
    Posts
    55
    I have PHP 5.2.x rpms available in my yum archive if that helps at all. You can add it with:

    wget -q -O - http://www.atomicorp.com/installers/atomic |sh

    and run "yum update". There is an additional wiki page documenting some common issues with upgrading a system from 4 to 5 here:

    http://www.atomicorp.com/wiki/index.php/PHP
    Secure your server now: Atomic Secured Linux
    Troubleshooting Linux Firewalls in stores today

  6. #6
    Join Date
    Oct 2004
    Location
    Kerala, India
    Posts
    4,750
    mickscool,

    You dont need to give all options as the previous. If you are not sure which all modules are needed by your sites, consult with someone. Most basic things are listed below, while this is not a complete list.

    ./configure -with-apxs2=/usr/sbin/apxs --with-xml --enable-bcmath --enable-calendar --with-curl --enable-ftp --with-gettext --with-mysql=/usr --with-pear
    David | www.cliffsupport.com
    Affordable Server Management Solutions sales AT cliffsupport DOT com
    CliffWebManager | Access WHM from iPhone and Android

  7. #7
    Join Date
    Jul 2007
    Posts
    68
    Quote Originally Posted by atomicturtle View Post
    I have PHP 5.2.x rpms available in my yum archive if that helps at all. You can add it with:

    wget -q -O - http://www.atomicorp.com/installers/atomic |sh

    and run "yum update". There is an additional wiki page documenting some common issues with upgrading a system from 4 to 5 here:

    http://www.atomicorp.com/wiki/index.php/PHP
    Thanks so much .. it worked like a charm and now i can see PHP 5.2.5 in phpinfo();

    I first tried "Plis" ./configure command but it was throwing the same error, so i tried your suggestion and it was really easy and it worked. I wish I could have found this method earlier ....

    Thanks again ... really appreciate it !!!

  8. #8
    Join Date
    Jan 2005
    Location
    Scotland, UK
    Posts
    2,549
    Quote Originally Posted by mickscool View Post
    Thanks so much .. it worked like a charm and now i can see PHP 5.2.5 in phpinfo();

    I first tried "Plis" ./configure command but it was throwing the same error, so i tried your suggestion and it was really easy and it worked. I wish I could have found this method earlier ....

    Thanks again ... really appreciate it !!!
    The primary issue is because you are using the configure command which builds those modules into php itself and you already have an RPM based install of php so /etc/php.d is trying to include the modules (even though you have already built them into PHP).

    If you do need to upgrade again you should stick to using the prebuilt RPM's (such as the ones you were given in this thread) or get the SRPM and build your own.
    Server Management - AdminGeekZ.com
    Infrastructure Management, Web Application Performance, mySQL DBA. System Automation.
    WordPress/Magento Performance, Apache to Nginx Conversion, Varnish Implimentation, DDoS Protection, Custom Nginx Modules
    Check our wordpress varnish plugin. Contact us for quote: [email protected]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •