Probably a silly question about the different PHP handlers, but wanting to make sure.

BakkerM

Verified User
Joined
Jul 10, 2015
Messages
33
I have (silly) question. For some time it has been possible to select different PHP handlers with DirectAdmin, which is really great.

You have the choice of the following PHP handlers;

- mod_php
- suPHP
- lsphp
- php-fastcgi
- php-fpm

Normally we used mod_php + suPHP (with PHP 5.6 and 7.x). However this is not the best performance.
We tried php-fastcgi in the past and we had some mixed results; like some websites simply didn't work anymore and others indeed loaded faster.

Now recently we tried php-fpm and we are very happy with it so far, but is it 100% compatible with for example: mod_php & suPHP?
Because, as mentioned above, php-fastcgi, wasn't for example...

I prefer to use php-fpm, because it's really fast(er) than mod_php & suPHP in my personal opinion.
I understand that with php-fpm, php is being run as a stand-alone PHP server.

Can someone, when they are willing to, provide some insight in this. I can find information on all PHP handlers, but never a direct comparism of all handlers and if they are compatible with each other.

Thank you in advance for your time.

Regards
 
If you enable htscanner module, it will work compatible with the setup you are mentioning but much more secure than mod_php and with better performace than suphp. Php-fpm is the best option at the moment - highly recommended!

Without the htscanner module, you won't be able to set php flags from .htaccess file as you were able with mod_php.
 
Thank you for your reply. Highly appreciated and learning new things every day! :)

So, correct me if I am wrong, if I use php-fpm and I have .htaccess files (for eg. with Wordpress) it will not work without?

Example code for a Wordpress .htaccess file:

Code:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

In other words, mod_rewrites and such won't work without htscanner in combination with php-fpm?

Thanks.
 
No, it will work!

The htscanner module will allow you to use the php_flag options in htaccess file. Without it, htaccess still works (mod_rewrite will be ok!), but it cannot modify PHP flags like mod_php can.

For example:

Code:
php_flag display_errors off

in .htaccess will require htscanner module.
 
Last edited:
Sorry for the late reply, was sick.
Thank you for your replies! Highly appreciated.
 
Back
Top