SOLVED Centos 7: Error build PHP 7.4 & 8.1

Basicly if when I update to Almalinux will everything still work for my clients. Things like SSL and most important mail.
I need to be able to go back to previous if something goes wrong and I can't fix it. If there is an issue it needs to be fixed fast.
So I think it will be best to start a clean new server and slowly move everything.
 
Basicly if when I update to Almalinux will everything still work for my clients. Things like SSL and most important mail.
Yes, several people (including me) have upgraded their Centos 7 to Almalinux, search for "inplace upgrade " at the forum
I need to be able to go back to previous if something goes wrong and I can't fix it.
If you have an VPS start with an snaphot when bare metal there are other solutions
So I think it will be best to start a clean new server and slowly move everything.
If you have the time for it this is the best approach
 
I had the same issue on a Centos 7 server, fixed like this (DA 1.656 on current update channel):
Code:
cd /usr/local/directadmin/custombuild
./build update
./build list_removals
./build remove_items

then a message came that I had to manually remove something so I did with this command:
./build remove_old_local libiconv
this command showed that I had to do a ./build all afterwards because things would otherwise be corrupted.

So lastly I issued this commands:
da build all

Be aware, during compilation it will throw some errors about php-fpm not being able to be started but that is normal, after the build all is ready, everything is working flawlessly again.
I followed this instruction because I am now stuck on php 7.4 and 8.0 and I found out that the libzip was too old according to the failure.

However now I have this problem: https://forum.directadmin.com/threads/php-fpm82-is-currently-down.69538/ . most of the php versions simply refuse to build.

Shouldn't custombuild take care of these libraries? I'm a little confused why I am having so much trouble changing my php1,2,3,4 versions.
 
I had custom php build configurations that included iconv. after removing them I was able to build.
 
However now I have this problem:
You are posting in a solved thread and referring to a solved thread.
So I don't know exactly what is going on, I presume you followed the link and followingn posts which I referred to there? Being this one:

Also check the iconv tip from @RoRoo here.
 
You are posting in a solved thread and referring to a solved thread.
So I don't know exactly what is going on, I presume you followed the link and followingn posts which I referred to there? Being this one:

Also check the iconv tip from @RoRoo here.
I identified my issue as being identical (checking for libzip >= 0.11) and the solution presented here created some new issues for me. To be specific after the solution custombuilds refuses to build php and is referencing missing folders and other issues. Build all will also fail. A new solution is needed, which I found in a different thread. My problem is solved, I got it running again after the second fix. You are the author of both posts to thank you for that :)


I thought it would be best to share this for future references. So when others search for this lipzip issue they know they need additional steps.

ps I have never heard of iconv before comming to this thread. It is something that was either installed by custombuild or by centos. My question that remains would be why custombuild can't take care of keeping the required libzip up to spec so that simply doing build php doesn't break your server.
 
Thank you, that makes things clear for me. Sometimes I'm also having a bit of trouble since I'm not native English.

But it's good to see your issue is fixed now too. Indeed sharing for future references is always a good thing, thank you! (y)
 
I had the same issue on a Centos 7 server, fixed like this (DA 1.656 on current update channel):
Code:
cd /usr/local/directadmin/custombuild
./build update
./build list_removals
./build remove_items

then a message came that I had to manually remove something so I did with this command:
./build remove_old_local libiconv
this command showed that I had to do a ./build all afterwards because things would otherwise be corrupted.

So lastly I issued this commands:
da build all

Be aware, during compilation it will throw some errors about php-fpm not being able to be started but that is normal, after the build all is ready, everything is working flawlessly again.
Hi Richard,
today I was trying to add the 5th php version to a DirectAdmin on Centos 7 box.
Firstly i got an error about missed libzip, tried yum install libzip libzip-devel but and got the libip wrong version error.
Finally I executed your commands and got the error
*** There was an error while trying to configure Apache 2. Check the /usr/local/directadmin/custombuild/custom/ap2/configure.apache file

here is that file:
#!/bin/sh
"./configure" \
"--enable-systemd" \
"--prefix=/etc/httpd" \
"--exec-prefix=/etc/httpd" \
"--bindir=/usr/bin" \
"--sbindir=/usr/sbin" \
"--sysconfdir=/etc/httpd/conf" \
"--enable-so" \
"--enable-dav" \
"--enable-dav-fs" \
"--enable-dav-lock" \
"--enable-suexec" \
"--enable-deflate" \
"--enable-unique-id" \
"--enable-cgi" \
"--disable-cgid" \
"--enable-mods-static=most" \
"--enable-mpms-shared=all" \
"--with-suexec-caller=apache" \
"--with-suexec-docroot=/" \
"--with-suexec-gidmin=100" \
"--with-suexec-logfile=/var/log/httpd/suexec_log" \
"--with-suexec-uidmin=100" \
"--with-suexec-userdir=public_html" \
"--with-suexec-bin=/usr/sbin/suexec" \
"--with-included-apr" \
"--with-pcre=/usr/local" \
"--includedir=/usr/include/apache" \
"--libexecdir=/usr/lib/apache" \
"--libdir=/usr/lib/apache" \
"--mandir=/usr/share/man" \
"--datadir=/var/www" \
"--localstatedir=/var" \
"--enable-logio" \
"--enable-ssl" \
"--enable-rewrite" \
"--enable-http2" \
"--enable-proxy" \
"--enable-expires" \
"--enable-reqtimeout" \
"--with-ssl=/usr" \
"--disable-md" \
"--enable-speling" \
"--enable-headers"

After that i had a blank page in the DA php version list, and those others:

1728213667268.png
1728213749033.png

At the moment the sites are still running but it seems I can't compile no other php/apache related packages yet.
How can I fix it ?
 
Last edited:
Check the /usr/local/directadmin/custombuild/custom/ap2/configure.apache file
This might be the cause as this is a customisation. Also some things changed since may this year.

As you can read als @Magistar had to use a solution which he found somewhere else on the forum in a similar thread. That might help you too.
But I would suggest to compare that custom file for apache with the original one and see if you still need that customisation.

Unfortunately this is an issue which sometimes needs different solution. The solution I used worked for me and some others, but as you can see Magistar and you and some others require another solution.
I think it's best to check the similar threads to see what solutions are given there.
 
This might be the cause as this is a customisation. Also some things changed since may this year.

As you can read als @Magistar had to use a solution which he found somewhere else on the forum in a similar thread. That might help you too.
But I would suggest to compare that custom file for apache with the original one and see if you still need that customisation.

Unfortunately this is an issue which sometimes needs different solution. The solution I used worked for me and some others, but as you can see Magistar and you and some others require another solution.
I think it's best to check the similar threads to see what solutions are given there.
I compared that file with the default one (/usr/local/directadmin/custombuild/configure/ap2/configure.apache)
there are 2 difference:

"--with-pcre=/usr/local" \
"--enable-speling" \

I'll try to delete the custom file and rebuild all
 
during the rebuilding process I get

Installation of ModSecurity Rule Set has been finished.
mktemp: failed to create file via template '/usr/local/php74/etc/tmp.XXXXXXXXXX.php-fpm.conf': No such file or directory
install_custom_file: failed to create temp file for '/usr/local/php74/etc/php-fpm.conf'
Job for php-fpm56.service failed because the control process exited with error code. See "systemctl status php-fpm56.service" and "journalctl -xe" for details.
Job for php-fpm72.service failed because the control process exited with error code. See "systemctl status php-fpm72.service" and "journalctl -xe" for details.
Job for php-fpm73.service failed because the control process exited with error code. See "systemctl status php-fpm73.service" and "journalctl -xe" for details.
Failed to execute operation: No such file or directory
Failed to restart php-fpm74.service: Unit not found.
Job for php-fpm80.service failed because the control process exited with error code. See "systemctl status php-fpm80.service" and "journalctl -xe" for details.
PHP has been secured.
Restarting php-fpm80.
Job for php-fpm80.service failed because the control process exited with error code. See "systemctl status php-fpm80.service" and "journalctl -xe" for details.
Restarting php-fpm73.
Job for php-fpm73.service failed because the control process exited with error code. See "systemctl status php-fpm73.service" and "journalctl -xe" for details.
Restarting php-fpm72.
Job for php-fpm72.service failed because the control process exited with error code. See "systemctl status php-fpm72.service" and "journalctl -xe" for details.
Restarting php-fpm74.
Failed to restart php-fpm74.service: Unit not found.
Restarting php-fpm56.
Job for php-fpm56.service failed because the control process exited with error code. See "systemctl status php-fpm56.service" and "journalctl -xe" for details.
Copying custom ModSecurity rules to /etc/modsecurity.d/...
Defaulting to Comodo WAF SecDefaultAction...
mktemp: failed to create file via template '/usr/local/php74/etc/tmp.XXXXXXXXXX.php-fpm.conf': No such file or directory
install_custom_file: failed to create temp file for '/usr/local/php74/etc/php-fpm.conf'
2024/10/06 16:33:43 info executing task task=action=rewrite&value=httpd

but the rebuilding is continuing
 
Rebuild terminated with errors and all php versions down

checking for libzip >= 0.11 libzip != 1.3.1 libzip != 1.7.0... no
configure: error: Package requirements (libzip >= 0.11 libzip != 1.3.1 libzip != 1.7.0) were not met:

Requested 'libzip >= 0.11' but version of libzip is 0.10.1

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables LIBZIP_CFLAGS
and LIBZIP_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
install_php: failed to compile '/usr/local/directadmin/custombuild/cache/php-8.0.30.tar.gz' inside '/usr/local/directadmin/custombuild/tmp/tmp.8uz7MJTgXP.php-8.0.30.tar.gz'
2024/10/06 16:43:15 info executing task task=action=notify&message=CustomBuild+installation+has+failed%2C+please+check+the+following+file+for+more+information%3A%0A%2Fvar%2Flog%2Fdirectadmin%2Fcustombuild.1728225133.9603.YWxsAA.log&subject=CustomBuild+installation+has+failed&value=admin
2024/10/06 16:43:15 info finished task duration=179.453036ms task=action=notify&message=CustomBuild+installation+has+failed%2C+please+check+the+following+file+for+more+information%3A%0A%2Fvar%2Flog%2Fdirectadmin%2Fcustombuild.1728225133.9603.YWxsAA.log&subject=CustomBuild+installation+has+failed&value=admin

# systemctl status php-fpm56.service
● php-fpm56.service - The PHP FastCGI Process Manager
Loaded: loaded (/etc/systemd/system/php-fpm56.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Sun 2024-10-06 16:50:26 CEST; 2s ago
Process: 1876 ExecStart=/usr/local/php56/sbin/php-fpm56 --nodaemonize --pid=/run/php-fpm56.pid (code=exited, status=127)
Main PID: 1876 (code=exited, status=127)

Oct 06 16:50:26 systemd[1]: Starting The PHP FastCGI Process Manager...
Oct 06 16:50:26 php-fpm56[1876]: /usr/local/php56/sbin/php-fpm56: error while loading shared libraries: libjpeg.so.9: cannot open shared object file: No such file or directory
Oct 06 16:50:26 systemd[1]: php-fpm56.service: main process exited, code=exited, status=127/n/a
Oct 06 16:50:26 systemd[1]: Failed to start The PHP FastCGI Process Manager.
Oct 06 16:50:26 systemd[1]: Unit php-fpm56.service entered failed state.
Oct 06 16:50:26 systemd[1]: php-fpm56.service failed.

# journalctl -xe

Oct 06 16:53:02 xxxx.xxxx.net dovecot[10221]: auth-worker: Error: dovecot/auth: error while loading shared libraries: libiconv.so.2: cannot open shared object file: No such file or directory
Oct 06 16:53:02 xxxx.xxxx.net dovecot[1242]: master: Error: service(auth-worker): command startup failed, throttling for 60.000 secs
Oct 06 16:53:02 xxxx.xxxx.net dovecot[10221]: auth-worker: Fatal: master: service(auth-worker): child 2236 returned error 127
Oct 06 16:53:05 xxxx.xxxx.net dovecot[10221]: imap: Error: dovecot/imap: error while loading shared libraries: libiconv.so.2: cannot open shared object file: No such file or directory
Oct 06 16:53:05 xxxx.xxxx.net dovecot[1242]: master: Error: service(imap): command startup failed, throttling for 60.000 secs
Oct 06 16:53:05 xxxx.xxxx.net dovecot[10221]: imap: Fatal: master: service(imap): child 2238 returned error 127
Oct 06 16:53:07 xxxx.xxxx.net systemd[1]: Starting The PHP FastCGI Process Manager...
-- Subject: Unit php-fpm80.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit php-fpm80.service has begun starting up.
Oct 06 16:53:07 xxxx.xxxx.net php-fpm80[2241]: /usr/local/php80/sbin/php-fpm80: error while loading shared libraries: libwebp.so.7: cannot open shared object file: No such file or directory
Oct 06 16:53:07 xxxx.xxxx.net systemd[1]: php-fpm80.service: main process exited, code=exited, status=127/n/a
Oct 06 16:53:07 xxxx.xxxx.net systemd[1]: Failed to start The PHP FastCGI Process Manager.
-- Subject: Unit php-fpm80.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit php-fpm80.service has failed.
--
-- The result is failed.
Oct 06 16:53:07 xxxx.xxxx.net systemd[1]: Unit php-fpm80.service entered failed state.
Oct 06 16:53:07 xxxx.xxxx.net systemd[1]: php-fpm80.service failed.
Oct 06 16:53:08 xxxx.xxxx.net dovecot[10221]: imap-login: Error: dovecot/imap-login: error while loading shared libraries: libiconv.so.2: cannot open shared object file: No such file or directory
Oct 06 16:53:08 xxxx.xxxx.net dovecot[1242]: master: Error: service(imap-login): command startup failed, throttling for 60.000 secs
Oct 06 16:53:08 xxxx.xxxx.net dovecot[10221]: imap-login: Fatal: master: service(imap-login): child 2245 returned error 127
 
Last edited:
On a Centos 7 server (w Tux EOL) how can you tell which sites are still using 7.4?
Most of my PHP sites are using 8.2.
There is a renegade site using 7.4 (I get reports to upgrade) but cannot identify the site.
Off topic, but thanks for any reply.
 
On a Centos 7 server (w Tux EOL) how can you tell which sites are still using 7.4?

@jonium I don't know, always hard when EOL stuff is used.
Maybe best is to disable comodo-waf and mod_security and build first, see if that works.

Otherwise maybe @DirectAdmin Support or @Ohm J have a clue for these old things.
 
@jonium
try follow this instruction.
 

@jonium I don't know, always hard when EOL stuff is used.
Maybe best is to disable comodo-waf and mod_security and build first, see if that works.

Otherwise maybe @DirectAdmin Support or @Ohm J have a clue for these old things.

I did find it.
Server Manager / Custom HTTPD Configurations.

thanks all.
 
Back
Top