Multiple issues with CB2

mkniskanen

Verified User
Joined
Sep 17, 2008
Messages
80
Location
Lieksa, Finland
Note: I decided to post this one anew as there were no comments to it previously. I am currently having a severe headache with CB and seriously considering moving the services on the server to a clean, non-DA, non-CB one. I stress that a year ago I installed the server from scratch using the DA installation method and made no changes to the settings. So this is a clean DA/CB2 server.

The REMI repository, for instance, offers a good selection of ready-made RPMs for PHP installations for CentOS, including the most important extensions. Why not use that repo as an option for CentOS users?

Okay, now for the problems.

#1) The q&d way of running "build all d" will simply not work.

I have 1 GB real memory and 512 MB swap (a KVM VPS) so in total that is 1.5 GB. While opening another terminal and watching the memory usage with "top" I can see that the memory consumption grows when compiling PHP. When starting the build there is more than 700 MB free memory but at some point during the PHP7 build phase the amount of consumed memory gets very high and the compiler crashes due to insufficient memory.

Yes, it is the PHP build phase but there is more to it: The "build all" seems to consume more memory than a separate build.

#2) When building PHP separately seems to work (but only at the second or third build attempt) and after that I get a bunch of open_basedir errors:

Code:
Installing PEAR environment:      /usr/local/php71/lib/php/
PHP Warning:  realpath(): open_basedir restriction in effect. File(/tmp) is not within the allowed path(s): (./) in phar:///usr/local/directadmin/custombuild/php-7.1.11/pear/install-pear-nozlib.phar/System.php on line 483
PHP Warning:  realpath(): open_basedir restriction in effect. File(/tmp) is not within the allowed path(s): (./) in phar:///usr/local/directadmin/custombuild/php-7.1.11/pear/install-pear-nozlib.phar/System.php on line 483
PHP Warning:  realpath(): open_basedir restriction in effect. File(/tmp) is not within the allowed path(s): (./) in phar:///usr/local/directadmin/custombuild/php-7.1.11/pear/install-pear-nozlib.phar/System.php on line 483
PHP Warning:  is_executable(): open_basedir restriction in effect. File(/usr/local/bin/gpg) is not within the allowed path(s): (./) in phar:///usr/local/directadmin/custombuild/php-7.1.11/pear/install-pear-nozlib.phar/System.php on line 530
PHP Warning:  is_executable(): open_basedir restriction in effect. File(/sbin/gpg) is not within the allowed path(s): (./) in phar:///usr/local/directadmin/custombuild/php-7.1.11/pear/install-pear-nozlib.phar/System.php on line 530
PHP Warning:  is_executable(): open_basedir restriction in effect. File(/bin/gpg) is not within the allowed path(s): (./) in phar:///usr/local/directadmin/custombuild/php-7.1.11/pear/install-pear-nozlib.phar/System.php on line 530
PHP Warning:  is_executable(): open_basedir restriction in effect. File(/usr/sbin/gpg) is not within the allowed path(s): (./) in phar:///usr/local/directadmin/custombuild/php-7.1.11/pear/install-pear-nozlib.phar/System.php on line 530
PHP Warning:  is_executable(): open_basedir restriction in effect. File(/usr/bin/gpg) is not within the allowed path(s): (./) in phar:///usr/local/directadmin/custombuild/php-7.1.11/pear/install-pear-nozlib.phar/System.php on line 530
PHP Warning:  file_exists(): open_basedir restriction in effect. File(/root/.pearrc) is not within the allowed path(s): (./) in phar:///usr/local/directadmin/custombuild/php-7.1.11/pear/install-pear-nozlib.phar/PEAR/Config.php on line 653
PHP Warning:  realpath(): open_basedir restriction in effect. File(/tmp) is not within the allowed path(s): (./) in phar:///usr/local/directadmin/custombuild/php-7.1.11/pear/install-pear-nozlib.phar/System.php on line 483

Moreover, after that the installer gets stuck in install-pear and has to be killed using ctrl-c:

Code:
PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND
28391 root      20   0  212312  33360   7336 R  99.3  3.3  10:25.12 php

I do not think I have made any changes to PHP configuration(s) - it has been Custombuild 2 from day zero to avoid any problems. Currently, however, CB gives me more headache than ever before. Every time there is a need to upgrade PHP, for instance, it has to be done in the early hours of a Sunday morning and after crashes I must check carefully if there is anything that has been left out.

As for adding more memory I cannot justify doubling or quadrupling my server cost by increasing the memory to 2GB or 4GB because the web stuff on the server runs happily in less than 256 MB (tested 128 MB without problems). If there is no alternative to reduce build phase memory consumption then there are two options: #1) an option to use a repository or #2) clearly inform DA users about the minimum memory needed which I believe is somewhere around 2 GB.

I really, really wish there was an option to use the simple yum update for PHP, at least.

Edit: After the Ctrl-C above and a PHP-fpm restart the server has been running correctly. I cannot help but wonder why Custombuild is using PHP for modifying files in system directories when there are other options (bash, perl) that could do it without problems.
 
2)

https://www.directadmin.com/install.php

We highly recommend a processor of at least 500 Mhz even though DirectAdmin will run on slower systems. A minimum 1 GB of memory is required (2+ GB is preferred), with at least 2 GB of swap memory.

So they are recommending 2GB+. :) I don't know what exactly is causing your problems but ~ 2 years ago I was managing a small VPS with also 1GB of memory and I never had any problems with compiling PHP. Maybe you need to increase your swap?
 
Last edited:
I have since upgraded my server memory to 2 GB and it does not have the memory problems building PHP or anything else. I am now paying for the questionable privilege of having to compile the servers manually.

B U T

The PEAR environment problem is still there exactly as it was weeks ago. Compilation stops at "Installing PEAR environment" due to open_basedir restrictions.

WHY ON EARTH is this problem still there?

Code:
Installing PEAR environment:      /usr/local/php71/lib/php/
PHP Warning:  realpath(): open_basedir restriction in effect. File(/tmp) is not within the allowed path(s): (./) in phar:///usr/local/directadmin/custombuild/php-7.1.13/pear/install-pear-nozlib.phar/System.php on line 483
PHP Warning:  realpath(): open_basedir restriction in effect. File(/tmp) is not within the allowed path(s): (./) in phar:///usr/local/directadmin/custombuild/php-7.1.13/pear/install-pear-nozlib.phar/System.php on line 483
PHP Warning:  realpath(): open_basedir restriction in effect. File(/tmp) is not within the allowed path(s): (./) in phar:///usr/local/directadmin/custombuild/php-7.1.13/pear/install-pear-nozlib.phar/System.php on line 483
PHP Warning:  is_executable(): open_basedir restriction in effect. File(/usr/local/bin/gpg) is not within the allowed path(s): (./) in phar:///usr/local/directadmin/custombuild/php-7.1.13/pear/install-pear-nozlib.phar/System.php on line 530
PHP Warning:  is_executable(): open_basedir restriction in effect. File(/sbin/gpg) is not within the allowed path(s): (./) in phar:///usr/local/directadmin/custombuild/php-7.1.13/pear/install-pear-nozlib.phar/System.php on line 530
PHP Warning:  is_executable(): open_basedir restriction in effect. File(/bin/gpg) is not within the allowed path(s): (./) in phar:///usr/local/directadmin/custombuild/php-7.1.13/pear/install-pear-nozlib.phar/System.php on line 530
PHP Warning:  is_executable(): open_basedir restriction in effect. File(/usr/sbin/gpg) is not within the allowed path(s): (./) in phar:///usr/local/directadmin/custombuild/php-7.1.13/pear/install-pear-nozlib.phar/System.php on line 530
PHP Warning:  is_executable(): open_basedir restriction in effect. File(/usr/bin/gpg) is not within the allowed path(s): (./) in phar:///usr/local/directadmin/custombuild/php-7.1.13/pear/install-pear-nozlib.phar/System.php on line 530
PHP Warning:  file_exists(): open_basedir restriction in effect. File(/root/.pearrc) is not within the allowed path(s): (./) in phar:///usr/local/directadmin/custombuild/php-7.1.13/pear/install-pear-nozlib.phar/PEAR/Config.php on line 653
PHP Warning:  realpath(): open_basedir restriction in effect. File(/tmp) is not within the allowed path(s): (./) in phar:///usr/local/directadmin/custombuild/php-7.1.13/pear/install-pear-nozlib.phar/System.php on line 483
^Cmake[1]: *** [install-pear-installer] Interrupt
make: *** [install-pear] Interrup
t
 
I did some digging with the problem and what happens does happen here in Makefile:

Code:
install-pear-installer: $(SAPI_CLI_PATH)
        @$(top_builddir)/sapi/cli/php $(PEAR_INSTALL_FLAGS) pear/install-pear-nozlib.phar -d "$(peardir)" -b "$(bindir)" ${PEAR_PREFIX} ${PEAR_SUFFIX}

The (just built) PHP executable is told to run the install-pear-nozlib.phar file. The (just built) php.ini, however, has open_basedir set to "." so it has no permission to open files in the directories /tmp, /usr/local/ and so forth.

That way the .phar file fails and the php cli is stuck in a neverending loop.

I stress (once again) that if something is broken it must have been broken by DA or Custombuild from day 1. I have not made any changes to setup because I will this server to my successor at some point.

To avoid breaking the system I would certainly want to hear some advice about the correct way to handle this headache.
 
Richard,

Those threads are almost 10 years old. The problem is *NOT* about "wanting to keep open_basedir" but about the out-of-the-box problems of Custombuild2. What it does and has been doing is wrong. It (or the DA installation) has set the open_basedir initially (or at some point uknown to me) and after that nothing has worked properly.

I am simply asking somebody to do something about the Custombuild, at least add some error handling there instead of leaving the process to an endless loop. When one installs something like Directadmin one does not expect needing to patch things.

And once again: CB (and why not DA itself) should really have the option use a repository for upgrading PHP and/or MySQL. If somebody wants to compile PHP it is ok, of course, but the I believe it would be much nicer get a message "There is a new version of PHPx available" and an option to run the yum/apt from inside DA. I understand that is a big feature upgrade but it would be *very* handy.
 
The problem is *NOT* about "wanting to keep open_basedir" but about the out-of-the-box problems of Custombuild2.
Your question was very clear:
To avoid breaking the system I would certainly want to hear some advice about the correct way to handle this headache.
Which was about the lack of rights from open basedir when using pear. I answered to that. It does not always matter for a solution if a topic 10 years old, especially because in both there is a link to the still existing help section about it.

From several topics I'm aware about your thoughts concerning custombuild, can't help you with that.
 
I have 1 GB real memory and 512 MB swap (a KVM VPS) so in total that is 1.5 GB.

Same specs on a CentOS 6 VPS over here, and no problems whatsoever compiling any version of PHP. Did a bunch of upgrades over the weekend, including two PHP builds through CB2. PHP compiles take a while, but run without errors. Am I just lucky?
 
Back
Top