Install several versions of php

chelssi

Verified User
Joined
Aug 2, 2019
Messages
34
Hi,

Right now I have running php 7.2 in php1_release, I would like instal php 7.3 in php2_release and 7.4 in php3_release (all with php_fpm) and after be able sellect any o those versions in each domain.

If I change this in the control panel at "CustomBuild/Edit options" and click save after I suppose I have to do something more, build php in build software? something more?

I'm using opcache and memcached in php 7.2, will be available in other two versions with this process or I have to do something more?

In custombuild/options.conf I have this:

Code:
#PHP Settings
php1_release=7.2
php1_mode=php-fpm
php2_release=no
php2_mode=php-fpm
php3_release=no
php3_mode=php-fpm
php4_release=no
php4_mode=php-fpm
secure_php=yes
php_ini=no
php_timezone=Europe/Paris
php_ini_type=production
x_mail_header=yes

Thanks
 
make it look like
php1_release=7.2
php1_mode=php-fpm
php2_release=7.3
php2_mode=php-fpm
php3_release=7.4
php3_mode=php-fpm
php4_release=no
php4_mode=php-fpm

then run
Code:
cd /usr/local/directadmin/custombuild
./build clean
./build update
./build php
./build rewrite_confs

This will build all the different versions out.

how did you add this currently
I'm using opcache and memcached in php 7.2, will be available in other two versions with this process or I have to do something more?
If you used Alex's script you might have to run it again.
 
Hi,

I don't know Alex's script, what does it do? where can I get it?

For installing opcache I ran this:

Code:
# cd /usr/local/directadmin/custombuild
# ./build set opcache yes
# ./build opcache

For Memcached this:

Code:
# cd /usr/local/directadmin/scripts/custom
# wget https://raw.githubusercontent.com/poralix/directadmin-utils/master/php/php-extension.sh -O php-extension.sh
 # chmod 750 php-extension.sh
 #  ./php-extension.sh
 #  yum install Memcached -y
 # yum install memcached-devel -y
 # yum install ibmemcached-devel -y
 # yum install libmemcached packages -y
 # yum install libmemcached -y
 # ./php-extension.sh install memcached
 # ./php-extension.sh status Memcached
 
 #/usr/local/php72/bin/pecl install memcached
 
 At /usr/local/php72/lib/php.conf.d/90-custom.ini I added extension=memcached.so
 
Hi Brent,

Ok, I'm going to do it.

One question about custombuild, I have an update to mariadb and I see in "/usr/local/directadmin/custombuild/options.conf" at MySQL Settings the next:

Code:
#MySQL Settings
mysql=5.6
mariadb=10.4
mysql_inst=mariadb
mysql_backup=yes
mysql_backup_gzip=no
mysql_backup_dir=/usr/local/directadmin/custombuild/mysql_backups
mysql_force_compile=no

The line "mysql_backup_dir=/usr/local/directadmin/custombuild/mysql_backups" means that it is going to do a backup there before update or I have to do it myself previously?

Thank you,
Carlos
 
it all right here.. read it all top to bottom :cool:


MySQL/MariaDB options:
  • mariadb - this option is used to choose the version of MariaDB. Possible values: 5.5, 10.0, 10.1, 10.2, 10.3, 10.4 (default: 10.0).
  • mysql - this option is used to choose the version of MySQL. Possible values: 5.1, 5.5, 5.6, 5.7, 8.0 (default: 5.6).
  • mysql_inst - install/update MySQL/MariaDB using "./build mysql", "./build mariadb" or "./build all". Possible values: mysql/mariadb/no (default: no).
  • mysql_backup - backup MySQL every time with MySQL/MariaDB update. Possible values: yes/no (default: yes).
 
Hi brent,

I 've just the instalation of php 7.3 and 7.4 and now nginx do not start, I have Apache and nginx (nginx as a reverse proxy for Apache).

I have this:

Code:
# service systemctl status nginx.service
Redirecting to /bin/systemctl status  nginx.service systemctl.service
● nginx.service - The nginx HTTP and reverse proxy server
   Loaded: loaded (/etc/systemd/system/nginx.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since lun 2020-04-27 02:41:01 CEST; 1s ago
  Process: 16325 ExecStartPre=/usr/sbin/nginx -t -c /etc/nginx/nginx.conf (code=exited, status=1/FAILURE)
 Main PID: 1965 (code=exited, status=0/SUCCESS)

abr 27 02:41:01 cld3.domain.com systemd[1]: Starting The nginx HTTP and reverse proxy server...
abr 27 02:41:01 cld3.domain.com nginx[16325]: nginx: [emerg] "modsecurity_rules_file" directive Rules error. File: /usr/local/cwaf/rules/00_Init_Initialization.conf. Line: 15. Colum...enable.conf:2
abr 27 02:41:01 cld3.domain.com nginx[16325]: nginx: configuration file /etc/nginx/nginx.conf test failed
abr 27 02:41:01 cld3.domain.com systemd[1]: nginx.service: control process exited, code=exited status=1
abr 27 02:41:01 cld3.domain.com systemd[1]: Failed to start The nginx HTTP and reverse proxy server.
abr 27 02:41:01 cld3.domain.com systemd[1]: Unit nginx.service entered failed state.
abr 27 02:41:01 cld3.domain.com systemd[1]: nginx.service failed.
Unit systemctl.service could not be found.
Hint: Some lines were ellipsized, use -l to show in full.
 
Ah. See if the below helps.
Code:
cd /usr/local/directadmin/custombuild
./build update
./build nginx_apache
./build rewrite_confs

Also is this a new server?
 
Hi,

It doesn't work.

No, it isn't new, i don't know what to do.

Thanks,
Carlos
 
ok what OS?
How long has it been since you update the OS?

what does
Code:
./build options
show

How did you change the options conf? with the plugin? or with text editor?
 
Actually its a mod security error
abr 27 02:41:01 cld3.domain.com nginx[16325]: nginx: [emerg] "modsecurity_rules_file" directive Rules error. File: /usr/local/cwaf/rules/00_Init_Initialization.conf. Line: 15. Colum...enable.conf:2
Look at your status.

Maybe you changed something with mod security?
 
Hi,

I changed options conf with text editor and after I checked by console.

Code:
Nginx Unit: no
Apache: 2.4.43
Nginx (reverse proxy): 1.17.10
mod_ruid2: no
LibModSecurity: 3.0.4
LibModSecurity Rule Set: comodo
htscanner: no
Dovecot: 2.3.10
Dovecot configuration: yes
AWstats: no
Exim: 4.93.0.4
exim.conf update: yes, release 4.5
BlockCracking: no
Easy Spam Fighter: yes
SpamAssassin: 3.4.4
SpamAssassin rule updates: daily
ClamAV: 0.102.2
MariaDB: 10.4.12
MySQL backup: yes
MySQL backup directory: /usr/local/directadmin/custombuild/mysql_backups
MySQL compress backups: no
PHP (default): 7.2 as php-fpm
PHP (additional): 7.3 as php-fpm
PHP (additional, 3rd): 7.4 as php-fpm
phpMyAdmin: 4.9.5-all-languages
ProFTPD: no
Pure-FTPd: 1.0.49
RoundCube webmail: 1.4.3
Replace "php.ini" with './build all' and './build php_ini': no
Cron for notifications and (or) updates: yes
Cron frequency: daily
Auto notifications: yes
Auto notifications email address: xxx
Run "clean" every time: yes
Run "clean_old_webapps" every time: yes
Run "clean_old_tarballs" every time: yes
Show texts in bold: yes
SquirrelMail: no
Zend Guard Loader: no
ionCube loader: no
Suhosin: no
 
Last edited:
LibModSecurity Rule Set: comodo
  • modsecurity_ruleset - chooses ModSecurity Rule Set to install when "./build modsecurity_rules", "./build modsecurity", "./build apache", "./build nginx" or "./build all d" is ran. Set to 'no' to use no ruleset (or to use a custom one, uploaded to custom/modsecurity/conf directory. Comodo option provides Comodo Rule Set for ModSecurity: https://modsecurity.comodo.com/. OWASP ModSecurity Core Rule Set: https://www.owasp.org/index.php/Category:OWASP_ModSecurity_Core_Rule_Set_Project. Add custom rules to custom/modsecurity/conf, they are added automatically to /etc/modsecurity.d after './build modsecurity' or './build modsecurity_ruleset' is ran. Nginx is not compatible with Comodo Rule Set yet. Possible values: comodo/owasp/no. (default: comodo).
 
I've uninstalled mod_security setting in webserver settings "modsecurity" to no and built "nginx+Apache" after I "Rewrite WEB server configuration files" but apache do not start, nginx is up.

Code:
# service httpd status
Redirecting to /bin/systemctl status httpd.service
● httpd.service - The Apache HTTP Server
   Loaded: loaded (/etc/systemd/system/httpd.service; enabled; vendor preset: disabled)
   Active: reloading (reload) (Result: exit-code) since lun 2020-04-27 04:02:48 CEST; 6s ago
  Process: 11075 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
 Main PID: 11075 (code=exited, status=1/FAILURE)
   Status: "Reading configuration..."
   CGroup: /system.slice/httpd.service

abr 27 04:02:48 cld3.cahams.com systemd[1]: httpd.service failed.
abr 27 04:02:48 cld3.cahams.com systemd[1]: Starting The Apache HTTP Server...
abr 27 04:02:48 cld3.cahams.com httpd[11075]: AH00513: WARNING: MaxRequestWorkers of 700 is not an integer multiple of ThreadsPerChild of 64, decreasing to nearest multiple 640, for a maximum of 10 servers.
abr 27 04:02:48 cld3.cahams.com systemd[1]: Started The Apache HTTP Server.
abr 27 04:02:48 cld3.cahams.com systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
 
ok so did you run the remove_items commands?

Code:
cd /usr/local/directadmin/custombuild
./build remove_items
./build update
./build php
./build nginx_apache
./build rewrite_confs

if this doesnt work

run
Code:
cd /usr/local/directadmin/custombuild
./build all
 
The first option didn't work I'm doing ./build all

How long take this?

Thanks,
Carlos
 
Back
Top