PHP: zts or not? (SourceGuardian extension problem)

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
axvaster
Posts: 21
Joined: Tue Jan 08, 2019 11:54 am

Re: PHP: zts or not? (SourceGuardian extension problem)

Post by axvaster »

Code: Select all

$ grep -R 'ixed\|sourceguardian' /etc/php*
/etc/php.d/sourceguardian.ini:extension=ixed.7.2ts.lin
/etc/php.ini:extension=/usr/lib64/php-zts/modules/ixed.7.2ts.lin
/etc/php.ini:extension=/usr/lib64/php/modules/ixed.7.2.lin

Code: Select all

$ ls -l /etc/php.d
total 168
-rw-r--r-- 1 root root 4847 Sep 30 13:30 10-opcache.ini
-rw-r--r-- 1 root root   44 Sep 30 13:36 20-bz2.ini
-rw-r--r-- 1 root root   54 Sep 30 13:36 20-calendar.ini
-rw-r--r-- 1 root root   48 Sep 30 13:36 20-ctype.ini
-rw-r--r-- 1 root root   46 Sep 30 13:36 20-curl.ini
-rw-r--r-- 1 root root   44 Sep 30 13:36 20-dom.ini
-rw-r--r-- 1 root root   46 Sep 30 13:36 20-exif.ini
-rw-r--r-- 1 root root   54 Sep 30 13:36 20-fileinfo.ini
-rw-r--r-- 1 root root   44 Sep 30 13:36 20-ftp.ini
-rw-r--r-- 1 root root   42 Sep 30 13:36 20-gd.ini
-rw-r--r-- 1 root root   52 Sep 30 13:36 20-gettext.ini
-rw-r--r-- 1 root root   48 Sep 30 13:36 20-iconv.ini
-rw-r--r-- 1 root root   46 Sep 30 13:36 20-json.ini
-rw-r--r-- 1 root root   46 Sep 30 13:36 20-ldap.ini
-rw-r--r-- 1 root root   54 Sep 30 13:36 20-mbstring.ini
-rw-r--r-- 1 root root   52 Sep 30 13:36 20-mysqlnd.ini
-rw-r--r-- 1 root root   44 Sep 30 13:36 20-pdo.ini
-rw-r--r-- 1 root root   48 Sep 30 13:36 20-pgsql.ini
-rw-r--r-- 1 root root   46 Sep 30 13:36 20-phar.ini
-rw-r--r-- 1 root root   48 Sep 30 13:36 20-posix.ini
-rw-r--r-- 1 root root   48 Sep 30 13:36 20-shmop.ini
-rw-r--r-- 1 root root   56 Sep 30 13:36 20-simplexml.ini
-rw-r--r-- 1 root root   46 Sep 30 13:36 20-snmp.ini
-rw-r--r-- 1 root root   52 Sep 30 13:36 20-sockets.ini
-rw-r--r-- 1 root root   52 Sep 30 13:36 20-sqlite3.ini
-rw-r--r-- 1 root root   52 Sep 30 13:36 20-sysvmsg.ini
-rw-r--r-- 1 root root   52 Sep 30 13:36 20-sysvsem.ini
-rw-r--r-- 1 root root   52 Sep 30 13:36 20-sysvshm.ini
-rw-r--r-- 1 root root   56 Sep 30 13:36 20-tokenizer.ini
-rw-r--r-- 1 root root   44 Sep 30 13:36 20-xml.ini
-rw-r--r-- 1 root root   56 Sep 30 13:36 20-xmlwriter.ini
-rw-r--r-- 1 root root   44 Sep 30 13:36 20-xsl.ini
-rw-r--r-- 1 root root   50 Sep 30 13:36 30-mysqli.ini
-rw-r--r-- 1 root root   56 Sep 30 13:36 30-pdo_mysql.ini
-rw-r--r-- 1 root root   56 Sep 30 13:36 30-pdo_pgsql.ini
-rw-r--r-- 1 root root   58 Sep 30 13:36 30-pdo_sqlite.ini
-rw-r--r-- 1 root root   46 Sep 30 13:36 30-wddx.ini
-rw-r--r-- 1 root root   56 Sep 30 13:36 30-xmlreader.ini
-rw-r--r-- 1 root root   49 Jul 26  2018 40-ssh2.ini
-rw-r--r-- 1 root root  645 Sep 30 13:36 opcache-default.blacklist
-rw-r--r-- 1 root root   25 Nov 19 16:05 sourceguardian.ini

Code: Select all

$ ls -l /usr/local/lib/php/extensions
ls: cannot access /usr/local/lib/php/extensions: No such file or directory


And, The php error message as below:

Code: Select all

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib64/php-zts/modules/ixed.7.2ts.lin' (tried: /usr/lib64/php-zts/modules/ixed.7.2ts.lin (/usr/lib64/php-zts/modules/ixed.7.2ts.lin: undefined symbol: core_globals_id), /usr/lib64/php/modules//usr/lib64/php-zts/modules/ixed.7.2ts.lin.so (/usr/lib64/php/modules//usr/lib64/php-zts/modules/ixed.7.2ts.lin.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'ixed.7.2ts.lin' (tried: /usr/lib64/php/modules/ixed.7.2ts.lin (/usr/lib64/php/modules/ixed.7.2ts.lin: undefined symbol: core_globals_id), /usr/lib64/php/modules/ixed.7.2ts.lin.so (/usr/lib64/php/modules/ixed.7.2ts.lin.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
The messages seems the same that no matter I put 'ixed.7.2ts.lin' in
/usr/lib64/php-zts/modules/
or in
/usr/lib64/php/modules/


And the php.ini is attached.


Meanwhile, I will keep eyes on it to make sure no fatal error.

Because it runs well so far; not sure what would happen.


Thank you for help!
You do not have the required permissions to view the files attached to this post.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: PHP: zts or not? (SourceGuardian extension problem)

Post by ssax »

Remove these lines from your /etc/php.ini:

Code: Select all

extension=/usr/lib64/php-zts/modules/ixed.7.2ts.lin
extension=/usr/lib64/php/modules/ixed.7.2.lin
Then run these commands:

Code: Select all

cd /tmp
rm -rf nagiosxi xi*
rm -rf /usr/lib64/php-zts/modules/ixed*
rm -rf /usr/lib64/php/modules/ixed*
rm -rf /etc/php.d/sourceguardian.ini
wget https://assets.nagios.com/downloads/nagiosxi/xi-latest.tar.gz
tar xzf xi-latest.tar.gz
cd nagiosxi
./init.sh
sed -i '/^PHP script/d' xi-sys.cfg
sed -i '/^1)/d' xi-sys.cfg
sed -i '/^2)/d' xi-sys.cfg
sed -i '/^3)/d' xi-sys.cfg
./install-sourceguardian-extension.sh
systemctl restart httpd
That will install the non-zts version in /usr/lib64/php/modules/ and should work.

I'm really not sure why you were originally seeing it request the zts version.

If that doesn't resolve it, try doing an in-place upgrade:

Download the same version that you have installed and put it in the /tmp folder:

https://www.nagios.com/downloads/nagios ... -releases/

Then run these commands to do a same-version upgrade:

Code: Select all

cd /tmp
rm -rf /tmp/nagiosxi
tar zxf YOURFILENAMETHATYOUDOWNLOADED
cd nagiosxi
./upgrade
Locked