Changed my mind about php-frm.

pucky

Verified User
Joined
Sep 9, 2006
Messages
794
Iv changed my mind about running php-frm with php 5.3. I installed 5.3 + php-frm and 5.4 as cgi phpsup.

I want to change the 5.3 config. I see that is created a number of files in directory /usr/local/53*. If i rerun CB2.0 and change the options to 5.3 phpsup will i have to do anything else to the files already installed in /usr/local?. Example. remove the directory before running the recompile. Also, what happens to the php-frm config/setup? Is the build script smart enough to remove that installation?
 
If you have chosen FastCGI, PHP-FPM or suPHP, PHP gets installed to /usr/local/php53 (or 54, 55), if you switch the mode, it just overwrites files under that directory (so you don't need to remove anything). php.ini is located here: /usr/local/php53/lib/php.ini
 
And what about custom php.ini (per customer) in case of "fastcgi"? In FAQ i see only info about custom php.ini in php-fpm
 
And what about custom php.ini (per customer) in case of "fastcgi"? In FAQ i see only info about custom php.ini in php-fpm

1. Own php.ini

Ok, I've found it, it's /usr/local/directadmin/data/users/$user/php/$domain.ini

but isn't working ;( I've put there /userdomain.com.ini and in userdomain.com check phpinfo(). Nothing changes, default values.

2. Switching PHP versions 5.3 / 5.4

In FAQ is section only for php-fpm and nothing for fastcgi. Beside that there are some confusing me notes:

Add this to .htaccess for PHP 5.3 as default for php-fpm:
Code:
<FilesMatch \.php$>
SetHandler php53-fcgi
</FilesMatch>

Add this to .htaccess for PHP 5.3 as default for php-fpm:
Code:
<FilesMatch "\.(inc|php|php3|php4|php44|php5|php52|php53|php54|php55|phtml|phps)$">
AddHandler x-httpd-php53 .php
</FilesMatch>

Twice for php-fpm?!?

Anyway both not working for fastcgi. Apache showing pure php file (NOT parsed, in text) (of course 5.3 is working when i run test.php53)
 
Last edited:
Custom php.ini:
Code:
FCGIWrapper "/usr/local/safe-bin/fcgid|PHP1_RELEASE|.sh [B]PATH_TO_PHP.INI[/B]" .php
 
Custom php.ini:
Code:
FCGIWrapper "/usr/local/safe-bin/fcgid|PHP1_RELEASE|.sh [B]PATH_TO_PHP.INI[/B]" .php

As I wrote before: isn't working.


/directadmin/data/users/user/httpd.conf:
Code:
FCGIWrapper "/usr/local/safe-bin/fcgid54.sh /usr/local/directadmin/data/users/user/php/userdomain.com.ini" .php

Making sure that we change this file, change memory_limit from 128 to 64:
Code:
# cat /usr/local/directadmin/data/users/user/php/userdomain.com.ini | grep memory_limit
memory_limit = [B]64M[/B]

And test
Code:
lynx -dump http://userdomain.com/test.php | grep memory_limit
   memory_limit [B]128M 128M[/B]

Not working ;(
 
Try to restart httpd after change value in custom php.ini
 
Last edited:
Of course is not working ;)

I'm wonder why using
Code:
<FilesMatch \.php$>
SetHandler php53-fcgi
</FilesMatch>

I get a pure txt (non parsed PHP file) ?!? Of course when I change *.php to *.php53 everything works fine with 5.3

Anyway I don't see anywhere definition of this Handler "php53-fcgi".
 
ad. 1

Yep, it's working with adding this line with FCGIWrapper, result: X-Powered-By: PHP/5.3.23


ad. 2

Yes,

Code:
[root@s55 safe-bin]# cat /usr/local/safe-bin/fcgid53.sh
#!/bin/sh

PHP_VER=53

OPTIONS=
if [ "$1" != "" ]; then
        if [ -s "$1" ]; then
                OPTIONS=" -c ${1} ${OPTIONS}"
        fi
fi

# http://httpd.apache.org/mod_fcgid/mod/mod_fcgid.html
# Set desired PHP_FCGI_* environment variables.
# Example:
# PHP FastCGI processes exit after 500 requests by default.
# JE: Do not limit it to facilitate XCache (or set it really high, like 10000)
PHP_FCGI_MAX_REQUESTS=0
export PHP_FCGI_MAX_REQUESTS

# See http://www.webhostingtalk.com/archive/index.php/t-1165678.html
PHP_FCGI_CHILDREN=0
export PHP_FCGI_CHILDREN
exec /usr/local/php53/bin/php-cgi53 ${OPTIONS}

What make me thinking: I try to change /directadmin/data/users/user/httpd.conf and set path to /home/user/php.ini (because I don't know if it's CB bug or maybe again something with CageFS, I wanna test it) where user have right to read file. Save changes. Stop Apache. Start apache. And still have (/status-info show mod_fcgid connections) old path even that user have other path in his httpd.conf!

Process: fcgid54.sh (/usr/local/safe-bin/fcgid54.sh /usr/local/directadmin/data/users/user/php/userdomain.com.ini)

WTF?!? I'm missing something?
 
Yes, php.ini file reading might be denied by CageFS, try disabling it or placing php.ini in /home/user.
 
Ok, I try yours FCGIWrapper in .htaccess and there set up path /home/user/php.ini and.. voila... works!

Loaded Configuration File /home/user/domainuser.com.ini

Hmm, so maybe this is really cageFS issue. In that case path /directadmin/data/users should be also copied (cagefsctl) into it ;(
Of course another solution to path to /home/user but probably not everyone may give it to user. Or maybe is third option - cageFS in new to me. (or place customphp.ini in php54/php53 path)

Anyway still don't know why changes in httpd.conf don't working.
 
Last edited:
OK, and how to FIX that SETHANDLER? I don't wanna place FCGIWrapper in user .htaccess - this should be in httpd conf.
 
Hey guys! HELP PLS ;)

I try to google it (mod_fcgid + example of many handlers) but I don't find any example how to do it ;(

I need working switch php5.3/5.4 in htaccess for customer and, as I write above, I don't wanna place FCGIWrapper in user .htaccess - this should be in httpd conf.
 
For now you can assign .php3 .php4 to the 1st selected version of PHP using custom templates (/usr/local/directadmin/data/templates/custom).
 
Back
Top