So Ive noticed rather weird behavior of PHP selector. So were using lsapi on all of our cPanel server and configured them correctly in order to use custom PHP versions for some directories (added in /etc/container/php.handler lines like "application/x-lsphp52 /opt/alt/php52/usr/bin/lsphp" .
So when we add string "AddType application/x-lsphp52 .php5 .php4 .php .php3 .php2 .phtml" to .htaccess, PHP version switches correctly. However it loads without necessary PHP modules (like mysql) while they are selected in PHP selector for this version:
We noticed, that alt_php.ini loads only for currently selected PHP version, while for other PHP versions only empty default.ini loads:
The content of default.ini below:
So the question is - how to connect selected in PHP selector modules for user, for PHP versions wich differs from the default one? As currently theres no point in switching between PHP versions inside one account (on directory basis).
Sorry, if this topic was previosly discussed, as I havent found it
So when we add string "AddType application/x-lsphp52 .php5 .php4 .php .php3 .php2 .phtml" to .htaccess, PHP version switches correctly. However it loads without necessary PHP modules (like mysql) while they are selected in PHP selector for this version:
Code:
# cl-selector --list-extensions=php --user dincomua --version=5.2 bcmath dom gd hidef htscanner imap json mcrypt mysql mysqli pdo pdo_mysql pdo_sqlite phar posix sockets xmlreader xmlwriter
Code:
dincomua@shared [/root]# /opt/alt/php52/usr/bin/php -m [PHP Modules] bz2 calendar ctype curl date exif filter ftp gettext gmp hash iconv libxml mhash openssl pcntl pcre readline Reflection session shmop SimpleXML SPL standard tokenizer xml zlib [Zend Modules] dincomua@shared [/root]#
Code:
dincomua@shared [/root]# ls -l /opt/alt/php5*/link/conf/ /opt/alt/php51/link/conf/: total 12 drwxr-xr-x 2 root 486 4096 Mar 22 02:18 ./ drwxr-xr-x 13 root root 4096 Mar 22 02:18 ../ -rw-r--r-- 1 root 486 211 Mar 9 09:13 default.ini /opt/alt/php52/link/conf/: total 12 drwxr-xr-x 2 root 486 4096 Mar 22 02:18 ./ drwxr-xr-x 15 root root 4096 Mar 22 02:18 ../ -rw-r--r-- 1 root 486 268 Apr 22 14:36 default.ini /opt/alt/php53/link/conf/: total 12 drwxr-xr-x 2 root 486 4096 Mar 22 02:18 ./ drwxr-xr-x 15 root root 4096 Mar 22 02:18 ../ -rw-r--r-- 1 root 486 229 Mar 9 10:01 default.ini /opt/alt/php54/link/conf/: total 12 drwxr-xr-x 2 root 486 4096 Mar 22 02:18 ./ drwxr-xr-x 16 root root 4096 Mar 22 02:18 ../ -rw-r--r-- 1 root 486 229 Mar 9 09:32 default.ini /opt/alt/php55/link/conf/: total 12 drwxr-xr-x 2 dincomua dincomua 4096 Apr 19 02:21 ./ drwxr-xr-x 10 dincomua dincomua 4096 Feb 3 11:41 ../ -rw-r--r-- 1 dincomua dincomua 628 Apr 19 02:21 alt_php.ini /opt/alt/php56/link/conf/: total 12 drwxr-xr-x 2 root 486 4096 Apr 19 02:05 ./ drwxr-xr-x 14 root root 4096 Apr 19 02:06 ../ -rw-r--r-- 1 root 486 229 Apr 5 04:00 default.ini dincomua@shared [/root]#
Code:
dincomua@shared [/root]# cat /opt/alt/php52/link/conf/default.ini ;extension=mbstring.so ;extension=bcmath.so ;extension=dom.so ;extension=json.so ;extension=gd.so ;extension=posix.so ;extension=sockets.so ;extension=xmlreader.so ;extension=xmlwriter.so ;extension=zip.so ;extension=fileinfo.so dincomua@shared [/root]#
Sorry, if this topic was previosly discussed, as I havent found it
Comment