New build system (BETA)

One is suPhp (cgi), the other is cli (as usual). You can pick which one you want to do what. If you have php 4 as the "default php", any script you currently run on php 4 won't be affected. Going from cli to suPhp consists of the script running as the user instead of apache, so that's the catch that has to be considered at. (directories and files might need re-chown-ing if it's an existing system)

John
 
So on existing servers would I be best off running php4 as cli and php5 as suPhp? I think that would be best for new servers as well as we move folk towards php5.

Do you think that new servers should be provisioned to default to php5? I think so but I'm not sure, and of course it could cause problems with moving users between servers.

Nevertheless, I like:

Old servers:
default: php4
cli: php4
suPHP: php5

New servers:
default: php5
cli: php4
suPHP: php5

Does that look reasonable to you?

Thanks.

Jeff
 
Yes, that's probably best.

As for php5 as default, you can chose whatever you want as default.
If you just want the "default" custombuild though, it wil give you apache 2 and php 5... as php4 *is* eol very soon, so we have to at least show some signs of moving with it ;) .. but you can use anything you want.

John
 
Yes, that's probably best.

As for php5 as default, you can chose whatever you want as default.
If you just want the "default" custombuild though, it wil give you apache 2 and php 5... as php4 *is* eol very soon, so we have to at least show some signs of moving with it ;) .. but you can use anything you want.

John
I guess my last question is how do I change the default? Is that what the script is for?

And my last comment is that sure wish there was a good documentation set for custombuild.

Hopefully someone will write one for the wiki when it goes live (probably in less than a week).

Any takers ;)

Jeff
 
You can edit the options.conf at any time, run "./build all" and it does everything for you, "clean" included, httpd.conf rewrites as well, conversions as well. Fairly painless.

John
 
Hey guys , i'm curious i fyou would be able to put some sort of file checking inplace to make the script check to see if the file is in the local folder before trying to download it.
 
There is already, unless you mean something else. The only exception is mod_perl because the version number isn't in the filename.

John
 
But for CustomBuild mod_perl has the version number and is checked too :)
 
Hi all, I just did a ./build all and after that I get an error trying to access Installatron (which worked before) saying: Installatron Error #4: Unable to Load POSIX

Where can I enable this or should I ./bulid all again with different settings in configure.php4 and configure.php5 and if so what do I put in those files to make it work?
 
Make custom php configuration files with --disable-posix removed. Then run "./build php n".
 
Hi, I still get this in my phpinfo:
'./configure' '--prefix=/usr/local/php5' '--enable-force-cgi-redirect' '--enable-fastcgi' '--with-config-file-path=/usr/local/etc/php5/cgi' '--with-curl' '--with-curl-dir=/usr/local/lib' '--with-gd' '--with-gd-dir=/usr/local/lib' '--with-gettext' '--with-jpeg-dir=/usr/local/lib' '--with-freetype' '--with-freetype-dir=/usr/local/lib' '--with-kerberos' '--with-mcrypt' '--with-mhash' '--with-mysql=/usr' '--with-mysqli=/usr/bin/mysql_config' '--with-pear=/usr/local/lib/php' '--with-png-dir=/usr/local/lib' '--with-xml' '--with-zlib' '--with-zlib-dir=/usr/local/lib' '--with-zip' '--with-openssl' '--with-iconv=/usr/local' '--enable-bcmath' '--enable-calendar' '--enable-ftp' '--enable-magic-quotes' '--enable-sockets' '--enable-track-vars' '--enable-mbstring' '--disable-posix' '--enable-memory-limit'

Do I need to set --enable-posix in configure.php4 and configure.php5 ?
 
No, just remove it :) The custom file should be located in /usr/local/directadmin/custombuild/custom/suphp/configure.php5.
 
i think we should have pdo_mysql enabled by default too since most PHP 5 Frameworks, like Zend Framework require you to use pdo_mysql.

And I am currently stuck on how to enable pdo_mysql at the moment. Can someone help?

Thanks.
 
One is suPhp (cgi), the other is cli (as usual). You can pick which one you want to do what. If you have php 4 as the "default php", any script you currently run on php 4 won't be affected. Going from cli to suPhp consists of the script running as the user instead of apache, so that's the catch that has to be considered at. (directories and files might need re-chown-ing if it's an existing system)

John

I am still confused about CLI vs CGI issue as explained above.
It's my understanding that both are compiled as a binary as opposed to Apache module we are currently running on production servers.
From a programming perspective, the only difference between CLI and CGI binaries is in the way they handle command line parameters, current directory, generate headers and such. Here is an official reference for details: http://us2.php.net/manual/en/features.commandline.php.

suPHP is basically a wrapper similar to suexec. Just like suexec, suPHP won't execute scripts of another user as security measure. The reason suPHP doesnt work with PHP binary compiled as CLI is because that binary doesn't generate HTTP headers.

Now, the questions part:

Q1. If all this is correct, then I really need you to clarify what you mean by "any script you currently run on php 4 won't be affected"? Are you saying that a move from our current production servers running PHP as Apache module to the new servers with PHP CLI will be completely transparent for all the sites?
As far as I recall, there are some differences between mod_php and PHP compiled as a binary in addition to effective user id issue. For example, the value of PHP_SELF and similar superglobal variables, current directories etc that might cause some of the script to behave differently.

Q2. What's the difference from performance standpoint between CLI and CGI options?

Thank you.
 
BTW, I am now experimenting with custombuild and here is what I found out:

I've selected CGI for both PHP4 and PHP5 during DA install and it didn't complain. Here is the relevant part from the options file:
default_php=4
php5_cli=no
php5_cgi=yes
php4_cli=no
php4_cgi=yes
php_ini=yes

Here is the info about compiled binaries:
[root@testdrive ~]# /usr/local/php4/bin/php -v
PHP 4.4.7 (cgi-fcgi) (built: Nov 20 2007 20:15:29)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies
with Zend Extension Manager v1.2.0, Copyright (c) 2003-2006, by Zend Technologies
with Zend Optimizer v3.2.8, Copyright (c) 1998-2007, by Zend Technologies
[root@testdrive ~]# /usr/local/php5/bin/php -v
PHP 5.2.5 (cli) (built: Nov 20 2007 20:31:47)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies

Here is a simple file I used to check user id under which PHP4 and PHP5 scripts are running:
<?
$name = basename($_SERVER['PHP_SELF']);
touch("/tmp/$name");
?>
Surprisingly, both /tmp/info.php /tmp/info.php5 files are owned by the user (not apache).

Lastly, an attempt to rebuild php with
default_php=4
php5_cli=no
php5_cgi=yes
php4_cli=yes
php4_cgi=no
php_ini=yes
failed with the following error:
/usr/bin/ld: /usr/local/lib/libltdl.a(ltdl.o): relocation R_X86_64_32S against `a local symbol' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libltdl.a(ltdl.o): could not read symbols: Bad value
collect2: ld returned 1 exit status
make: *** [libphp4.la] Error 1

*** The make has failed, do you want to try to make again? (y,n): n
 
How do I get the latest version of this script? I've not found a download link in the last 3 pages of this thread...

Regards,
 
Onno, please let us know how it went for you. We're starting to use custombuild on at least one of our testbed servers later this month.

Jeff
 
Hello,

When whe add more than 243 users to the system apache wont start and whe get the message:
PHP:
/etc/init.d/httpd: line 55: 24292 Segmentation fault      $ENV $httpd -k start -DSSL

When whe disabled the last line in /etc/httpd/conf/extra/directadmin-vhosts.conf apache will start again.

It seems that whe not to able to add more than 243 users to this server.
whe used custombuild with apache 2.2.8 and php 5.2.x
 
Back
Top