2 issues after PHP upgrade

Kinkz

Verified User
Joined
Dec 1, 2017
Messages
5
On a server I upgraded PHP from 7.0 to 7.2 by following the following this article: https://help.directadmin.com/item.php?id=345
One website is now having troubles and is giving 2 errors and I can't seem to figure out wat is causing it.

In the error log I see this error:
PHP Startup: Unable to load dynamic library '/usr/local/php70/lib/php/extensions/no-debug-non-zts-20151012/pdo_pgsql' - /usr/local/php70/lib/php/extensions/no-debug-non-zts-20151012/pdo_pgsql: cannot open shared object file: No such file or directory in Unknown on line 0

PHP Warning: PHP Startup: Unable to load dynamic library 'pgsql' (tried: /usr/local/php72/lib/php/extensions/no-debug-non-zts-20170718/pgsql (/usr/local/php72/lib/php/extensions/no-debug-non-zts-20170718/pgsql: cannot open shared object file: No such file or directory), /usr/local/php72/lib/php/extensions/no-debug-non-zts-20170718/pgsql.so (/usr/local/php72/lib/php/extensions/no-debug-non-zts-20170718/pgsql.so: cannot open shared object file: No such file or directory)) in Unknown on line 0, referer: https://<>/backend.php/administrator/account

Using the browser console I'm also seeing this error:
Access to XMLHttpRequest at 'https://site1/api/getSdf?country=Burundi&page=1' from origin 'https://site2' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.

This is the php setting in the options.conf:
#PHP Settings
php1_release=5.6
php1_mode=php-fpm
php2_release=7.2
php2_mode=suphp

And the custom/suphp/configure.php72:
#!/bin/sh
./configure \
--prefix=/usr/local/php72 \
--program-suffix=72 \
--with-config-file-scan-dir=/usr/local/php70/lib/php.conf.d \
--with-curl=/usr/local/lib \
--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 \
--with-openssl \
--with-mcrypt \
--with-mhash \
--with-mysql-sock=/var/lib/mysql/mysql.sock \
--with-mysqli=mysqlnd \
--with-pcre-regex=/usr/local \
--with-pdo-mysql=mysqlnd \
--with-pgsql=pgsql \
--with-pdo-pgsql=pdo_pgsql \
--with-pear \
--with-png-dir=/usr/local/lib \
--with-xsl \
--with-zlib \
--with-zlib-dir=/usr/local/lib \
--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
 

shivahost

Verified User
Joined
Mar 7, 2013
Messages
209
Now you can have 4 version of php: 5.6 - 7.0 - 7.2 - 7.3

I think you should install them and use 7.0 for that site.
 

zEitEr

Super Moderator
Joined
Apr 11, 2005
Messages
14,159
Location
GMT +7.00
Hello,

You need to rebuild pdo_pgsql extension for PHP 7.2 or disable it.

CORS policy does not have anything to do with PHP.
 

Kinkz

Verified User
Joined
Dec 1, 2017
Messages
5
Hello,

You need to rebuild pdo_pgsql extension for PHP 7.2 or disable it.

CORS policy does not have anything to do with PHP.
Thank you for the advice. How would I rebuild it? The only way I know is with './build php n', but I already did that and pdo_pgsql is already included in the custom/suphp/configure.php72 file.
 

Kinkz

Verified User
Joined
Dec 1, 2017
Messages
5
Remove lines

extension=pdo_pgsql.so
extension=pgsql.so

from php.ini then.
Ok thanks.
Any thoughts on the CORS error? I don't see any trace of their ever being a custom config for it, but it stopped working after the PHP upgrade and switching back to 7.0 didn't resolve it.
 

zEitEr

Super Moderator
Joined
Apr 11, 2005
Messages
14,159
Location
GMT +7.00
After you upgraded PHP apache's and/or nginx's virtual hosts have been rewritten by Directadmin. So if you manually and directly modified configs to disable/enable and/or fine-tune CORS for a domain, your modifications were lost.

So you might check templates and configs for CORS settings. Directadmin does not install, enable or support CORS, so it's up to you and your customers.
 
Top