Third PHP version

You can use build php_expert to install any possible PHP versions with CustomBuild. Run ./build to see usage details.
The other steps depends on how you want to run PHP: fastcgi, suphp, fpm.
 
It's possible to do this now :) 3rd and 4th. Requires pre-release binaries of DA (>=1.55)

php.jpg
 
And php_expert now takes care of creating all necessary files to start a new PHP-FPM instance.

Code:
./build php_expert 5.6 php-fpm

I believe Directadmin will allow to edit php-fpm settings under admin for all the 4 php versions, as of now it (Compile time: Jan 24 2019 at 17:11:45) does offer editing only of the first 2, the other versions can be modified only by changing php version in URL.
 
It's possible to do this now :) 3rd and 4th. Requires pre-release binaries of DA (>=1.55)

View attachment 2483

I see. It's great think :D.

I compiled 4 versions of PHP but i can't select all in DA panel (i see only php1_release and php2_release). How can i select higher php_release for specified domain (can be in /usr/local/directadmin/data/users/username/domains/domainename.conf).

Now i see for example
php1_select=2
php2_select=0

When i tried change php1_select for 3 or 4 nothings change.

Second question.
I have Debian 9 64 bit. I'm using PHP 5.4 (It's work because was installed before system upgrade).

I want to install PHP 5.5 but in this system version its hard because of openssl version but im sure so it's possible (PHP 5.4 works but impossibble to reinstall.
Code:
Makefile:632: recipe for target 'ext/openssl/openssl.lo' failed
make: *** [ext/openssl/openssl.lo] Error 1
make: *** Waiting for unfinished jobs....
In file included from /usr/local/directadmin/custombuild/php-5.5.38/main/php.h:38:0,
                 from /usr/local/directadmin/custombuild/php-5.5.38/ext/zlib/zlib.c:29:
/usr/local/directadmin/custombuild/php-5.5.38/Zend/zend_API.h:120:45: warning: initialization from incompatible pointer type [-Wincompatible-pointer-types]
 #define ZEND_MODULE_GLOBALS_CTOR_N(module)  zm_globals_ctor_##module
                                             ^
/usr/local/directadmin/custombuild/php-5.5.38/ext/zlib/zlib.c:1035:2: note: in expansion of macro 'ZEND_MODULE_GLOBALS_CTOR_N'
  ZEND_MODULE_GLOBALS_CTOR_N(zlib),
  ^~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/directadmin/custombuild/php-5.5.38/Zend/zend_API.h:120:45: note: (near initialization for 'php_zlib_module_entry.globals_ctor')
 #define ZEND_MODULE_GLOBALS_CTOR_N(module)  zm_globals_ctor_##module
                                             ^
/usr/local/directadmin/custombuild/php-5.5.38/ext/zlib/zlib.c:1035:2: note: in expansion of macro 'ZEND_MODULE_GLOBALS_CTOR_N'
  ZEND_MODULE_GLOBALS_CTOR_N(zlib),
  ^~~~~~~~~~~~~~~~~~~~~~~~~~
-e
*** The make has failed, would you like to try to make again? (y,n):
Is any way to compile with older openssl libraries?

Maybe someone share /usr/local/php55 folder for me? :)

BTW
Maybe you can add some switch to options.conf - allow old php.
Now i must comment this lines:
Code:
#php 5.5 and older will never compile with openssl 1.1.0
	if [ "${PHP1_RELEASE_OPT}" = "5.3" ] || [ "${PHP1_RELEASE_OPT}" = "5.4" ] || [ "${PHP1_RELEASE_OPT}" = "5.5" ] || [ "${PHP2_RELEASE_OPT}" = "5.3" ] || [ "${PHP2_RELEASE_OPT}" = "5.4" ] || [ "${PHP2_RELEASE_OPT}" = "5.5" ] || [ "${PHP3_RELEASE_OPT}" = "5.3" ] || [ "${PHP3_RELEASE_OPT}" = "5.4" ] || [ "${PHP3_RELEASE_OPT}" = "5.5" ] || [ "${PHP4_RELEASE_OPT}" = "5.3" ] || [ "${PHP4_RELEASE_OPT}" = "5.4" ] || [ "${PHP4_RELEASE_OPT}" = "5.5" ]; then
		OV=`openssl_version | cut -d. -f1,2`
		if [ "${OV}" != "" ] && [ "`version_cmp ${OV} 1.1 'php 5.x vs openssl 1.1.0 ver check'`" -ge 0 ]; then
			do_exit 1 "php 5.3, 5.4, 5.5 cannot compile against openssl 1.1.0 or higher. Try php 5.6 or higher."
		fi
	fi
... after build update because i can't do nothing after that :)

Regards
 
Last edited:
Check the details here: https://www.directadmin.com/features.php?id=2276

Custombuild 2.0.0 (rev: 1994) is required.

I've got this:

Code:
[root@server custombuild]# ./build options | grep ^PHP
PHP (default): 7.2 as php-fpm
PHP (additional): 7.1 as php-fpm
PHP (additional): 5.6 as php-fpm
PHP (additional): 5.4 as php-fpm
[root@server custombuild]#
 
I have Custombuild 2.0.0 (rev: 1994)
Code:
./build version
2.0.0 (rev: 1994)

./build options | grep ^PHP
PHP (default): 7.1 as php-fpm
PHP (additional): 5.4 as php-fpm
PHP (additional): 5.5 as php-fpm
PHP (additional): 7.2 as php-fpm

PHP 5.5 is not installed because openssl problem (debian 9).
I added this file into /usr/local/directadmin/custombuild/custom/ap2/configure.php55
Code:
#!/bin/sh
./configure \
        --with-apxs2 \
        --with-config-file-scan-dir=/usr/local/lib/php.conf.d \
        --with-curl \
        --with-gd \
        --enable-gd-native-ttf \
        --with-gettext \
        --with-jpeg-dir=/usr/local/lib \
        --with-freetype-dir=/usr/local/lib \
        --with-libxml-dir=/usr/local/lib \
        --with-kerberos \
        [B]--with-openssl-dir=/usr/src/openssl-1.0.2l[/B] \
        --with-mcrypt \
        --with-mhash \
        --with-mysql=mysqlnd \
        --with-mysql-sock=/var/lib/mysql/mysql.sock \
        --with-mysqli=mysqlnd \
        --with-pcre-regex=/usr/local \
        --with-pdo-mysql=mysqlnd \
        --with-pear \
        --with-png-dir=/usr/local/lib \
        --with-xsl \
        --with-zlib \
        --enable-zip \
        --with-iconv=/usr/local \
        --enable-bcmath \
        --enable-calendar \
        --enable-ftp \
        --enable-sockets \
        --enable-soap \
        --enable-mbstring \
        --with-icu-dir=/usr/local/icu \
        --enable-intl

What im doing wrong? It's possible fresh compile PHP 5.5 in Debian 9 64bit?

Code:
/usr/local/directadmin/custombuild/php-5.5.38/ext/openssl/openssl.c: In function 'zif_openssl_sign':
/usr/local/directadmin/custombuild/php-5.5.38/ext/openssl/openssl.c:4236:13: error: storage size of 'md_ctx' isn't known
  EVP_MD_CTX md_ctx;
             ^~~~~~
/usr/local/directadmin/custombuild/php-5.5.38/ext/openssl/openssl.c:4280:2: warning: implicit declaration of function 'EVP_MD_CTX_cleanup' [-Wimplicit-function-declaration]
  EVP_MD_CTX_cleanup(&md_ctx);
  ^~~~~~~~~~~~~~~~~~
/usr/local/directadmin/custombuild/php-5.5.38/ext/openssl/openssl.c: In function 'zif_openssl_verify':
/usr/local/directadmin/custombuild/php-5.5.38/ext/openssl/openssl.c:4294:17: error: storage size of 'md_ctx' isn't known
  EVP_MD_CTX     md_ctx;
                 ^~~~~~
/usr/local/directadmin/custombuild/php-5.5.38/ext/openssl/openssl.c: In function 'zif_openssl_seal':
/usr/local/directadmin/custombuild/php-5.5.38/ext/openssl/openssl.c:4355:17: error: storage size of 'ctx' isn't known
  EVP_CIPHER_CTX ctx;
                 ^~~
/usr/local/directadmin/custombuild/php-5.5.38/ext/openssl/openssl.c: In function 'zif_openssl_open':
/usr/local/directadmin/custombuild/php-5.5.38/ext/openssl/openssl.c:4479:17: error: storage size of 'ctx' isn't known
  EVP_CIPHER_CTX ctx;
                 ^~~
/usr/local/directadmin/custombuild/php-5.5.38/ext/openssl/openssl.c: In function 'zif_openssl_digest':
/usr/local/directadmin/custombuild/php-5.5.38/ext/openssl/openssl.c:4833:13: error: storage size of 'md_ctx' isn't known
  EVP_MD_CTX md_ctx;
             ^~~~~~
/usr/local/directadmin/custombuild/php-5.5.38/ext/openssl/openssl.c: In function 'zif_openssl_encrypt':
/usr/local/directadmin/custombuild/php-5.5.38/ext/openssl/openssl.c:4912:17: error: storage size of 'cipher_ctx' isn't known
  EVP_CIPHER_CTX cipher_ctx;
                 ^~~~~~~~~~
/usr/local/directadmin/custombuild/php-5.5.38/ext/openssl/openssl.c: In function 'zif_openssl_decrypt':
/usr/local/directadmin/custombuild/php-5.5.38/ext/openssl/openssl.c:4991:17: error: storage size of 'cipher_ctx' isn't known
  EVP_CIPHER_CTX cipher_ctx;
                 ^~~~~~~~~~
/bin/bash /usr/local/directadmin/custombuild/php-5.5.38/libtool --silent --preserve-dup-deps --mode=compile cc  -Iext/dom/ -I/usr/local/directadmin/custombuild/php-5.5.38/ext/dom/ -DPHP_ATOM_INC -I/usr/local/directadmin/custombuild/php-5.5.38/include -I/usr/local/directadmin/custombuild/php-5.5.38/main -I/usr/local/directadmin/custombuild/php-5.5.38 -I/usr/local/directadmin/custombuild/php-5.5.38/ext/date/lib -I/usr/local/directadmin/custombuild/php-5.5.38/ext/ereg/regex -I/usr/local/include/libxml2 -I/usr/local/include -I/usr/local/include/freetype2 -I/usr/local/include/libpng16 -I/usr/local/icu/include -I/usr/local/directadmin/custombuild/php-5.5.38/ext/mbstring/oniguruma -I/usr/local/directadmin/custombuild/php-5.5.38/ext/mbstring/libmbfl -I/usr/local/directadmin/custombuild/php-5.5.38/ext/mbstring/libmbfl/mbfl -I/usr/local/directadmin/custombuild/php-5.5.38/ext/sqlite3/libsqlite -I/usr/local/directadmin/custombuild/php-5.5.38/TSRM -I/usr/local/directadmin/custombuild/php-5.5.38/Zend    -I/usr/local/include -g -O2 -fvisibility=hidden  -c /usr/local/directadmin/custombuild/php-5.5.38/ext/dom/php_dom.c -o ext/dom/php_dom.lo
/bin/bash /usr/local/directadmin/custombuild/php-5.5.38/libtool --silent --preserve-dup-deps --mode=compile cc  -Iext/dom/ -I/usr/local/directadmin/custombuild/php-5.5.38/ext/dom/ -DPHP_ATOM_INC -I/usr/local/directadmin/custombuild/php-5.5.38/include -I/usr/local/directadmin/custombuild/php-5.5.38/main -I/usr/local/directadmin/custombuild/php-5.5.38 -I/usr/local/directadmin/custombuild/php-5.5.38/ext/date/lib -I/usr/local/directadmin/custombuild/php-5.5.38/ext/ereg/regex -I/usr/local/include/libxml2 -I/usr/local/include -I/usr/local/include/freetype2 -I/usr/local/include/libpng16 -I/usr/local/icu/include -I/usr/local/directadmin/custombuild/php-5.5.38/ext/mbstring/oniguruma -I/usr/local/directadmin/custombuild/php-5.5.38/ext/mbstring/libmbfl -I/usr/local/directadmin/custombuild/php-5.5.38/ext/mbstring/libmbfl/mbfl -I/usr/local/directadmin/custombuild/php-5.5.38/ext/sqlite3/libsqlite -I/usr/local/directadmin/custombuild/php-5.5.38/TSRM -I/usr/local/directadmin/custombuild/php-5.5.38/Zend    -I/usr/local/include -g -O2 -fvisibility=hidden  -c /usr/local/directadmin/custombuild/php-5.5.38/ext/dom/attr.c -o ext/dom/attr.lo
Makefile:632: recipe for target 'ext/openssl/openssl.lo' failed
make: *** [ext/openssl/openssl.lo] Error 1
make: *** Waiting for unfinished jobs....
-e

Regards
 
--with-openssl-dir should point (unlike a case with compiling nginx against custom OpenSSL version) to a compiled OpenSSL, but not an OpenSSL source directory.
 
Richard,

I don't use mod_php at all. Porbably somebody else can answer your question.
 
I compiled 4 versions of PHP but i can't select all in DA panel (i see only php1_release and php2_release). How can i select higher php_release for specified domain (can be in /usr/local/directadmin/data/users/username/domains/domainename.conf).

Now i see for example
php1_select=2
php2_select=0

As said in my post above, DA pre-release or higher version than 1.55 is needed. No custom skin should be used (unless it's supported there). And there should be only 1 dropdown seen, not 2, in latest version of DA. If you see selection for first and second version of PHP, it likely means you're using old version of DA :) I hope that answers your questions, if not - let me know.
 
As said in my post above, DA pre-release or higher version than 1.55 is needed. No custom skin should be used (unless it's supported there). And there should be only 1 dropdown seen, not 2, in latest version of DA. If you see selection for first and second version of PHP, it likely means you're using old version of DA :) I hope that answers your questions, if not - let me know.

Code:
/usr/local/directadmin/directadmin v
Version: DirectAdmin v.1.55.0

It's too old? Maybe i have some old stuff in user config files?

Check the details here: https://www.directadmin.com/features.php?id=2276

Custombuild 2.0.0 (rev: 1994) is required.

I've got this:

Code:
[root@server custombuild]# ./build options | grep ^PHP
PHP (default): 7.2 as php-fpm
PHP (additional): 7.1 as php-fpm
PHP (additional): 5.6 as php-fpm
PHP (additional): 5.4 as php-fpm
[root@server custombuild]#

Have you any solution to install PHP 5.5 on debian 9? Maybe you know where can i download precompiled libs, that will works with custombuild php 5.5?
I give up :(
 
@JohnyByk,

Install OpenSSL 1.0.2 into /usr/local/openssl-1.0.2/ and build PHP against it with --with-openssl-dir=/usr/local/openssl-1.0.2/

If it's somthing too complicated for you (though the forums have complete guides on how to install a custom openssl version), then you might need to get someone to do it for you. Directadmin stuff probably can do it for free, if I do it on your server I will charge you.
 
I installed openssl manually. openssl dir:

Code:
/usr/local/openssl-1.0.2l# ls -A
bin  include  lib  ssl

Still the same error. Maybe custombuild dosen't use custom configuration from custom/ap2/configure.php55

In error is /usr/local/directadmin/custombuild/php-5.5.38/ext/openssl/ directory
Code:
[B]/usr/local/directadmin/custombuild/php-5.5.38/ext/openssl/[/B]openssl.c:3017:14: error: dereferencing pointer to incomplete type 'EVP_PKEY {aka struct evp_pkey_st}'
  switch (pkey->type) {


Is any way to check witch configuration custombuild takes to compilation?

Regards
 
Last edited:
Code:
/usr/local/directadmin/directadmin v
Version: DirectAdmin v.1.55.0

It's too old?

The post clearly states that it should be higher than 1.55.0 or pre-release binaries (which would still show 1.55.0 as the version, but would have this feature).
 
Still the same error. Maybe custombuild dosen't use custom configuration from custom/ap2/configure.php55

When buiilding PHP the following locations are used:

- For PHP-FPM /usr/local/directadmin/custombuild/configure/fpm/
- For suPHP /usr/local/directadmin/custombuild/configure/suphp/
- For fastcgi /usr/local/directadmin/custombuild/configure/fastcgi/
- For mod PHP /usr/local/directadmin/custombuild/configure/ap2/

the same with custom/

- For PHP-FPM /usr/local/directadmin/custombuild/custom/fpm/
- For suPHP /usr/local/directadmin/custombuild/custom/suphp/
- For fastcgi /usr/local/directadmin/custombuild/custom/fastcgi/
- For mod PHP /usr/local/directadmin/custombuild/custom/ap2/
 
@SMtalk: Do you know the answer to my question? Is in this multiple php setup also a mod_ruid2 option possible or not at all?
Because with Cpanel I also can choose 4 different setups, but can point 1 of them to be mod_ruid2 if wanted.
Would be nice if this would also be possible with Directadmin.
 
Yeah, thats it.
Unfortunelly i have next error

Code:
/usr/bin/ld: /usr/local/openssl-1.0.2l/lib/libcrypto.a(cryptlib.o): relocation R_X86_64_PC32 against symbol `stderr@@GLIBC_2.2.5' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
Makefile:144: recipe for target 'libphp5.la' failed
make: *** [libphp5.la] Error 1
make: *** Waiting for unfinished jobs....

I tried compile open ssl with zlib and shared, zlib and no-shared. Both options give the same error.
I was looking for solution in google and nothing :(.
 
The solution is
Code:
export CFLAGS=-fPIC
in openssl source directory :).

Thanks for help.
Regards
 
The post clearly states that it should be higher than 1.55.0 or pre-release binaries (which would still show 1.55.0 as the version, but would have this feature).

Thanks for explanation. Can you tell us when this features will be released? :>
I haven't access to pre-release :]

Regards
 
Last edited:
Back
Top