CB2.0 problems (PECL doesn't work, PHP switching not working)

askmurphy

New member
Joined
Apr 5, 2010
Messages
2
Today, I installed a new Centos 6.4 server with the latest DirectAdmin 1.43.0 version.

First I tested the script with the recommended settings: works great, out of the box. (good work Martynas !!!)

After this I tried to install PHP5.3 with php-fpm as default and php5.4 with php-fpm as 2nd system, to be sure
I have no unused things on the server left, I have reinstalled the whole server from scratch again (harddisk formatted).

installed DA again, but now with option 4 (CB2.0 alpha) and manual selections:

apache
default php5.3 php-fpm
second php5.4 php-fpm
ruid2
ioncube
mysql 5.5
prevent symbolic links
exim
dovecot
phpmyadmin
roundcube

After installation, rebooted the system.

php -v gives this:

PHP 5.3.23 (cli) (built: Mar 21 2013 16:12:58)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2013 Zend Technologies
with the ionCube PHP Loader v4.2.2, C

So far so good.

Problem 1: PECL not found
-------------------------
After trying to installed memcached using pecl, i found out that the command pecl was not available.

Checking:
# pecl
-bash: pecl: command not found
# updatedb
# locate pecl
/usr/local/php53/bin/pecl
/usr/local/php53/lib/php/peclcmd.php
/usr/local/php53/lib/php/.channels/pecl.php.net.reg
/usr/local/php53/lib/php/.channels/.alias/pecl.txt
/usr/local/php53/lib/php/.registry/.channel.pecl.php.net
/usr/local/php54/bin/pecl
/usr/local/php54/lib/php/peclcmd.php
/usr/local/php54/lib/php/.channels/pecl.php.net.reg
/usr/local/php54/lib/php/.channels/.alias/pecl.txt
/usr/local/php54/lib/php/.registry/.channel.pecl.php.net
[root@goofy bin]# whereis pecl
pecl:
#

After trying to execute the command pecl with fullpath:

/usr/local/php54/bin/pecl
/usr/local/php54/bin/pecl: line 28: /usr/local/php54/bin/php: file or folder doesn't excist
/usr/local/php54/bin/pecl: line 28: exec: Can't execute /usr/local/php54/bin/php : file or folder doesn't excist

# /usr/local/php53/bin/pecl
/usr/local/php53/bin/pecl: line 28: /usr/local/php53/bin/php: file or folder doesn't excist
/usr/local/php53/bin/pecl: line 28: Can't execute /usr/local/php53/bin/php : file or folder doesn't excist

More details:

# ls -l /usr/local/php53/bin/
totaal 31948
-rwxr-xr-x. 1 root root 847 mrt 21 16:13 pear
-rwxr-xr-x. 1 root root 868 mrt 21 16:13 peardev
-rwxr-xr-x. 1 root root 784 mrt 21 16:13 pecl
lrwxrwxrwx. 1 root root 30 mrt 21 16:13 phar -> /usr/local/php53/bin/phar.phar
-rwxr-xr-x. 1 root root 14836 mrt 21 16:13 phar.phar
-rwxr-xr-x. 1 root root 32670698 mrt 21 16:13 php53
-rwxr-xr-x. 1 root root 3418 mrt 21 16:13 php-config53
-rwxr-xr-x. 1 root root 4514 mrt 21 16:13 phpize53

Problem 2: PHP switch .htaccess doesn't work
--------------------------------------------

Following the instructions on: http://forum.directadmin.com/showthread.php?t=44743

I have added this to .htaccess for PHP 5.4 as default for php-fpm:

Code:

<FilesMatch \.php$>
SetHandler php54-fcgi
</FilesMatch>


Checked this with a phpinfo.php file inside the same hostingpackage:

<?php
// Show all information, defaults to INFO_ALL
phpinfo();
?>

Result: the default php5.3 verion.

So, I hope someone has a fix for this all ??

Regards,

;-) Arthur
 
Hello,

confirm, pecl tries to execute

/usr/local/php53/bin/php or /usr/local/php54/bin/php (line 28):

Code:
exec /usr/local/php54/bin/php -C -n -q -d include_path=/usr/local/php54/lib/php -d date.timezone=UTC -d output_buffering=1 -d variables_order=EGPCS -d safe_mode=0 -d register_argc_argv=On /usr/local/php54/lib/php/peclcmd.php

but we have /usr/local/php53/bin/php53 and/or /usr/local/php54/bin/php54

Code:
# ls -1 /usr/local/php54/bin/
pear
peardev
pecl
phar
phar.phar
php54
php-cgi54
php-config54
phpize54

and

Code:
# ls -1 /usr/local/php53/bin/
pear
peardev
pecl
phar
phar.phar
php53
php-config53
phpize53

So we either need to modify pecl to execute /usr/local/php53/bin/php53 and/or /usr/local/php54/bin/php54 or create symlinks.
 
Today, I installed a new Centos 6.4 server with the latest DirectAdmin 1.43.0 version.

First I tested the script with the recommended settings: works great, out of the box. (good work Martynas !!!)

After this I tried to install PHP5.3 with php-fpm as default and php5.4 with php-fpm as 2nd system, to be sure
I have no unused things on the server left, I have reinstalled the whole server from scratch again (harddisk formatted).

installed DA again, but now with option 4 (CB2.0 alpha) and manual selections:

apache
default php5.3 php-fpm
second php5.4 php-fpm
ruid2
ioncube
mysql 5.5
prevent symbolic links
exim
dovecot
phpmyadmin
roundcube

After installation, rebooted the system.

php -v gives this:

PHP 5.3.23 (cli) (built: Mar 21 2013 16:12:58)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2013 Zend Technologies
with the ionCube PHP Loader v4.2.2, C

So far so good.

Problem 1: PECL not found
-------------------------
After trying to installed memcached using pecl, i found out that the command pecl was not available.

Checking:
# pecl
-bash: pecl: command not found
# updatedb
# locate pecl
/usr/local/php53/bin/pecl
/usr/local/php53/lib/php/peclcmd.php
/usr/local/php53/lib/php/.channels/pecl.php.net.reg
/usr/local/php53/lib/php/.channels/.alias/pecl.txt
/usr/local/php53/lib/php/.registry/.channel.pecl.php.net
/usr/local/php54/bin/pecl
/usr/local/php54/lib/php/peclcmd.php
/usr/local/php54/lib/php/.channels/pecl.php.net.reg
/usr/local/php54/lib/php/.channels/.alias/pecl.txt
/usr/local/php54/lib/php/.registry/.channel.pecl.php.net
[root@goofy bin]# whereis pecl
pecl:
#

After trying to execute the command pecl with fullpath:

/usr/local/php54/bin/pecl
/usr/local/php54/bin/pecl: line 28: /usr/local/php54/bin/php: file or folder doesn't excist
/usr/local/php54/bin/pecl: line 28: exec: Can't execute /usr/local/php54/bin/php : file or folder doesn't excist

# /usr/local/php53/bin/pecl
/usr/local/php53/bin/pecl: line 28: /usr/local/php53/bin/php: file or folder doesn't excist
/usr/local/php53/bin/pecl: line 28: Can't execute /usr/local/php53/bin/php : file or folder doesn't excist

More details:

# ls -l /usr/local/php53/bin/
totaal 31948
-rwxr-xr-x. 1 root root 847 mrt 21 16:13 pear
-rwxr-xr-x. 1 root root 868 mrt 21 16:13 peardev
-rwxr-xr-x. 1 root root 784 mrt 21 16:13 pecl
lrwxrwxrwx. 1 root root 30 mrt 21 16:13 phar -> /usr/local/php53/bin/phar.phar
-rwxr-xr-x. 1 root root 14836 mrt 21 16:13 phar.phar
-rwxr-xr-x. 1 root root 32670698 mrt 21 16:13 php53
-rwxr-xr-x. 1 root root 3418 mrt 21 16:13 php-config53
-rwxr-xr-x. 1 root root 4514 mrt 21 16:13 phpize53

Problem 2: PHP switch .htaccess doesn't work
--------------------------------------------

Following the instructions on: http://forum.directadmin.com/showthread.php?t=44743

I have added this to .htaccess for PHP 5.4 as default for php-fpm:

Code:

<FilesMatch \.php$>
SetHandler php54-fcgi
</FilesMatch>


Checked this with a phpinfo.php file inside the same hostingpackage:

<?php
// Show all information, defaults to INFO_ALL
phpinfo();
?>

Result: the default php5.3 verion.

So, I hope someone has a fix for this all ??

Regards,

;-) Arthur

It says specifically

•Do not use mod_ruid2 together with php-fpm

I install the same exact version of Centos along with 5.3 5.4 like you and my pecl shows;

Code:
[root@la1010 extra]# pecl
Commands:
build                  Build an Extension From C Source
bundle                 Unpacks a Pecl Package
channel-add            Add a Channel
channel-alias          Specify an alias to a channel name
channel-delete         Remove a Channel From the List
channel-discover       Initialize a Channel from its server
channel-info           Retrieve Information on a Channel
channel-login          Connects and authenticates to remote channel server
channel-logout         Logs out from the remote channel server
channel-update         Update an Existing Channel
clear-cache            Clear Web Services Cache
config-create          Create a Default configuration file
config-get             Show One Setting
config-help            Show Information About Setting
config-set             Change Setting
config-show            Show All Settings
convert                Convert a package.xml 1.0 to package.xml 2.0 format
cvsdiff                Run a "cvs diff" for all files in a package
cvstag                 Set CVS Release Tag
download               Download Package
download-all           Downloads each available package from the default channel
info                   Display information about a package
install                Install Package
list                   List Installed Packages In The Default Channel
list-all               List All Packages
list-channels          List Available Channels
list-files             List Files In Installed Package
list-upgrades          List Available Upgrades
login                  Connects and authenticates to remote server [Deprecated in favor of channel-login]
logout                 Logs out from the remote server [Deprecated in favor of channel-logout]
makerpm                Builds an RPM spec file from a PEAR package
package                Build Package
package-dependencies   Show package dependencies
package-validate       Validate Package Consistency
pickle                 Build PECL Package
remote-info            Information About Remote Packages
remote-list            List Remote Packages
run-scripts            Run Post-Install Scripts bundled with a package
run-tests              Run Regression Tests
search                 Search remote package database
shell-test             Shell Script Test
sign                   Sign a package distribution file
svntag                 Set SVN Release Tag
uninstall              Un-install Package
update-channels        Update the Channel List
upgrade                Upgrade Package
upgrade-all            Upgrade All Packages [Deprecated in favor of calling upgrade with no parameters]
Usage: pecl [options] command [command-options] <parameters>
Type "pecl help options" to list all options.
Type "pecl help shortcuts" to list all command shortcuts.
Type "pecl help <command>" to get the help for the specified command.
 
@smtalk - I think that, just like you're symlinking the php binary, you should symlink all the other binaries so that we can easily build extensions or install apps with standard tools and paths.

CB 2.0 should at least do this for the 1st php, if the user is not using mod_php
# ln -s /usr/local/php54/bin/pear /usr/local/bin/pear
# ln -s /usr/local/php54/bin/pecl /usr/local/bin/pecl
# ln -s /usr/local/php54/bin/phar /usr/local/bin/phar
# ln -s /usr/local/php54/bin/php-config /usr/local/bin/php-config
# ln -s /usr/local/php54/bin/phpize /usr/local/bin/phpize

Having those links in place allowed me to compile extensions which automagically landed in:
/usr/local/php54/lib/php/extensions/no-debug-non-zts-20100525

ready to be included in:
/usr/local/php54/lib/php.conf.d/directadmin.ini
 
Last edited:
This is still a problem, especially when changing PHP1 in CB2.

We need the proper symlinks to be created by CB.
 
@smtalk - I think that, just like you're symlinking the php binary, you should symlink all the other binaries so that we can easily build extensions or install apps with standard tools and paths.

CB 2.0 should at least do this for the 1st php, if the user is not using mod_php


Having those links in place allowed me to compile extensions which automagically landed in:
/usr/local/php54/lib/php/extensions/no-debug-non-zts-20100525

ready to be included in:
/usr/local/php54/lib/php.conf.d/directadmin.ini

Thanks :-)

This also fixed my problems with pear /pecl

Code:
ln -s /usr/local/php56/bin/pear /usr/local/bin/pear
ln -s /usr/local/php56/bin/pecl /usr/local/bin/pecl
ln -s /usr/local/php56/bin/phar /usr/local/bin/phar
ln -s /usr/local/php56/bin/php-config /usr/local/bin/php-config
ln -s /usr/local/php56/bin/phpize /usr/local/bin/phpize
 
Back
Top