• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

How do I upgrade to PHP 5

C

chillnet

Guest
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.
 
I'm also having the same problem as above. I'm compiling PHP5 from the SRPM in the fedora development branch.
 
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.
 
Bump... Just wanted to see if anyone has any ideas on why this is happening.
 
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
 
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
 
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
 
I did a source compile, otherwise I couldn't change the source

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

Gunter
 
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
 
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
 
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
 
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
 
no, not the one in /usr/local/psa it's the one of plesk itself. Don't touch this.
 
I installed httpd-devel and now I have/usr/sbin/apxs

Still no apxs2 though...
 
then try to install apache2-devel. What distribution are you using?
 
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...
 
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.
 
Back
Top