PHP 5.3, MPM worker, zts and mysqlnd
+
Par Remi le samedi 14 novembre 2009, 17:15 - General - Lien permanent
I received some asks for php with the new mysqlnd driver. Unfortunately, it was not possible to enable it in the same build than the standard one (libmysql). As I also want to test the use of php-zts, I think it was a good opportunity.
From now, version 5.3.1-0.6.RC4 provides all extensions for php, php-cli and php-zts and mysql extensions for zts use the mysqlnd driver. However, no php-pecl extension are available (we need a php-zts-devel).
Be careful, if an extension is available, this doesn't mean that it will work perfectly, because there is no warranty it's "thread-safe".
Few notes to configure apache in worker mode and use php-zts :
1. Installation
Packages are available for Fedora ≥ 10 and EL-5 in remi-test repository.
yum --enablerepo=remi-test \
--enablerepo=remi install php-zts
2. Apache settings
Stop the httpd service
Edit the /etc/sysconfig/httpd file and uncomment:
HTTPD=/usr/sbin/httpd.worker
Restart the service
The http://localhost/server-info page should report MPM Name: Worker
A phpinfo() page should report than MySQL extension use:Client API version mysqlnd 5.0.5-dev - 081106 - $Revision: 289630 $
3. MySQL settings
It seems that the mysqlnd driver didn't accept the old authentication protocol (used before mysql 4.1) which is set as default, for compatibility, in Fedora RPM..
So, you must edit the /etc/my.cnf file
old_passwords=0
Restart the MySQL server
And change all passwords to ensure the new strong encryption is used, for example:
$ mysql -p
mysql> UPDATE mysql.user SET Password = PASSWORD('topsecret') WHERE User = 'root';
mysql> flush privileges;
mysql> quit
Bye
4. PHP applications settings
There should have no change required (the small issue with previous version 0.5.RC4 and path to mysql.sock is fixed)
Well, now, it's your game ;)
Commentaires
Would you mind providing a non-zts version? My memcache extension doesn't work anymore.
Thank you!
@binBASH : don't understand your question. php still provide the standard (non-zts) version. If you don't want zts, simply don't enable it.
This tuto is explicitly for php-zts
+
I won't have mysqlnd then, right?
Exactly, you most choose
+
So I'm asking if there is possibly to have php with mysqlnd without zts. :-)
No.
Because libmysql is stable and mysqlnd experimental, I don't want to introduce this in standard packages.
+
Hmm, I understand.
Can you give instructions how to switch to the standard package then?
Or maybe provide a SRPM so I can disable it locally on my PC? Would be even better.
> Can you give instructions how to switch to the standard package then?
Re-read the above tuto, in step 2 comment the line you have uncommented.
> Or maybe provide a SRPM so I can disable it locally on my PC? Would be even better.
All SRPM are available in the repository.
+
Thanks a lot for the info.
I would like to ask you to please include php-fpm in the rpm!
Thanks
=Kevin
@Kevin : the php-fpm package is provided since PHP 5.3.3.
+
Me too!!!!
I need to use PHP-FPM.
Is it activated/enabled in the rpm?
Because I can not see it, there should be a config (php-fpm.conf) and bin files....
Thanks
@Kim : please use the forum, which is a better place for discussion than comments.
And try
+