Possible PHP 7.1 bug or crash on Centos 7??

Issues related to applications and software problems
lpallard
Posts: 50
Joined: 2014/09/17 02:39:48

Possible PHP 7.1 bug or crash on Centos 7??

Postby lpallard » 2017/12/03 18:20:10

Hello

I am running an OwnCloud instance on a Centos 7 VPS and recently had to upgrade PHP from 5.4.16 to 7.1.9 because OwnCloud considered PHP 5.x as "ancient". I managed to upgrade PHP with the following commands:

Install repos

Code: Select all

rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

Make backup of php.ini

Code: Select all

cp /etc/php.ini /etc/php.ini.bak

Uninstall all PHP 5.4 packages

Code: Select all

yum erase php*

Update repos

Code: Select all

yum update

Install all new PHP 7.x packages

Code: Select all

sudo yum install -y mod_php71w php71w-cli php71w-common php71w-gd php71w-mbstring php71w-mcrypt php71w-mysqlnd php71w-xml php71w-devel php71w-intl php71w-ldap php71w-pear php71w-pecl-apcu php71w-pecl-igbinary php71w-pecl-redis php71w-php-process php71w-xmlrpc


Now when I type "php -v" I get:

Code: Select all

[admin@cloud mainuser]# php -v
PHP 7.1.11 (cli) (built: Oct 29 2017 17:26:51) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies


I think PHP has been successfully upgraded to 7.1.

The problem is that I am experiencing all kind of strange issues with the webpage of Owncloud. Sometimes, I get blank pages, but a browser F5 brings the page back. File transfers are also sometimes timing out, the file list is sometimes not synced with the contents (for example I drag files to the cloud, they appear then I go back and the're gone but a refresh F5 makes them reappear.

I hava also other error messages from owncloud. The folks at Owncloud's forums are thinking PHP is crashing due to what I found in the apache logs:

in /var/log/httpd/php_errors

Code: Select all

[03-Dec-2017 00:18:07 UTC] PHP Warning:  require_once(): open_basedir restriction in effect. File(/usr/share/pear/pearcmd.php) is not within the allowed path(s): (/var/log/httpd/:/var/www/html/:/tmp/:/mnt/data/:/dev/urandom) in /usr/share/pear/peclcmd.php on line 31
[03-Dec-2017 00:18:07 UTC] PHP Warning:  require_once(/usr/share/pear/pearcmd.php): failed to open stream: Operation not permitted in /usr/share/pear/peclcmd.php on line 31
[03-Dec-2017 00:18:07 UTC] PHP Fatal error:  require_once(): Failed opening required 'pearcmd.php' (include_path='/usr/share/pear:/usr/share/pear') in /usr/share/pear/peclcmd.php on line 31


in /var/log/httpd/error_log

Code: Select all

[Sat Dec 02 21:17:58.247970 2017] [core:notice] [pid 11963] AH00052: child pid 11964 exit signal Segmentation fault (11)
[Sat Dec 02 21:17:58.248047 2017] [core:notice] [pid 11963] AH00052: child pid 11966 exit signal Segmentation fault (11)
[Sat Dec 02 21:17:59.255186 2017] [core:notice] [pid 11963] AH00052: child pid 11965 exit signal Segmentation fault (11)
[Sat Dec 02 21:17:59.255338 2017] [core:notice] [pid 11963] AH00052: child pid 11967 exit signal Segmentation fault (11)
[Sat Dec 02 21:18:14.287865 2017] [core:notice] [pid 11963] AH00052: child pid 11979 exit signal Segmentation fault (11)


Would it be possible that PHP crashes causing the issues I am having?

Apache

Code: Select all

Server version: Apache/2.4.6 (CentOS)
Server built:   Oct 19 2017 20:39:16



Thanks!!

User avatar
TrevorH
Forum Moderator
Posts: 21161
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Possible PHP 7.1 bug or crash on Centos 7??

Postby TrevorH » 2017/12/03 18:37:09

We don't recommend use of webtatic and certainly don't support their packages. If you need php 7.1 then there are two ways to get it - one is by using an SCL (yum install centos-release-scl then picking the relevant php71 packages from that or by using the IUS Repo. You can find a comparison of both methods in https://ius.io/IUSvsSCL/ and https://www.hogarthuk.com/?q=node/15 which discuss the pros and cons of SCL and IUS
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

lpallard
Posts: 50
Joined: 2014/09/17 02:39:48

Re: Possible PHP 7.1 bug or crash on Centos 7??

Postby lpallard » 2017/12/03 19:50:51

OK Trevor, thanks for replying.

I uninstalled the repos and the php packages and cleaned up the system. Then I reinstalled everything from Remi's repos and enabled remi-php71 then reinstalled the php packages from there.

Now php is up and running, but when I go to the cloud's webpage I see

Code: Select all

Memcache \OC\Memcache\APCu not available for local cache Is the matching PHP module installed and enabled?


So obviously the module APCu is either not properly installed or not activated. I installed this package from yum and remi-repo:

php71-php-pecl-apcu-5.1.8-1.el7.remi.x86_64

Still after a restart of apache I get the error message. Is there anything special to do to activate this module? Also I wonder if I should see it in /etc/httpd/modules which I dont!

Code: Select all

libphp7.so
libphp7-zts.so
mod_access_compat.so
mod_actions.so
mod_alias.so
mod_allowmethods.so
mod_asis.so
mod_auth_basic.so
mod_auth_digest.so
mod_authn_anon.so
mod_authn_core.so
mod_authn_dbd.so
mod_authn_dbm.so
mod_authn_file.so
mod_authn_socache.so
mod_authz_core.so
mod_authz_dbd.so
mod_authz_dbm.so
mod_authz_groupfile.so
mod_authz_host.so
mod_authz_owner.so
mod_authz_user.so
mod_autoindex.so
mod_buffer.so
mod_cache_disk.so
mod_cache.so
mod_cache_socache.so
mod_cgid.so
mod_cgi.so
mod_charset_lite.so
mod_data.so
mod_dav_fs.so
mod_dav_lock.so
mod_dav.so
mod_dbd.so
mod_deflate.so
mod_dialup.so
mod_dir.so
mod_dumpio.so
mod_echo.so
mod_env.so
mod_expires.so
mod_ext_filter.so
mod_file_cache.so
mod_filter.so
mod_headers.so
mod_heartbeat.so
mod_heartmonitor.so
mod_include.so
mod_info.so
mod_lbmethod_bybusyness.so
mod_lbmethod_byrequests.so
mod_lbmethod_bytraffic.so
mod_lbmethod_heartbeat.so
mod_log_config.so
mod_log_debug.so
mod_log_forensic.so
mod_logio.so
mod_lua.so
mod_macro.so
mod_mime_magic.so
mod_mime.so
mod_mpm_event.so
mod_mpm_prefork.so
mod_mpm_worker.so
mod_negotiation.so
mod_proxy_ajp.so
mod_proxy_balancer.so
mod_proxy_connect.so
mod_proxy_express.so
mod_proxy_fcgi.so
mod_proxy_fdpass.so
mod_proxy_ftp.so
mod_proxy_http.so
mod_proxy_scgi.so
mod_proxy.so
mod_proxy_wstunnel.so
mod_ratelimit.so
mod_reflector.so
mod_remoteip.so
mod_reqtimeout.so
mod_request.so
mod_rewrite.so
mod_sed.so
mod_setenvif.so
mod_slotmem_plain.so
mod_slotmem_shm.so
mod_socache_dbm.so
mod_socache_memcache.so
mod_socache_shmcb.so
mod_speling.so
mod_ssl.so
mod_status.so
mod_substitute.so
mod_suexec.so
mod_systemd.so
mod_unique_id.so
mod_unixd.so
mod_userdir.so
mod_usertrack.so
mod_version.so
mod_vhost_alias.so
mod_watchdog.so

pjsr2
Posts: 189
Joined: 2014/03/27 20:11:07

Re: Possible PHP 7.1 bug or crash on Centos 7??

Postby pjsr2 » 2017/12/03 21:47:25

Now when I type "php -v" I get:

Be aware that this command shows you the version of the php command line interpreter. It does not show you the version of php loaded by your web server.
Which version is of php is used by your web server depends on the version of the php module (a .so file) that your web server loads. Assuming you use Apache httpd, you can check the path to the php module that is set in the "LoadModule php_module" in your web server config or create a small web page that show the results of the phpinfo() function.
/etc/httpd/modules is a directory where modules are located. Not all modules in this directory are loaded; which of them are loaded depends on the LoadModule directives in your httpd configuration. It is also possible that some modules are installed in other directories than /etc/httpd/modules.

lpallard
Posts: 50
Joined: 2014/09/17 02:39:48

Re: Possible PHP 7.1 bug or crash on Centos 7??

Postby lpallard » 2017/12/04 01:11:26

OK I will check what php modules are loading. In the meantime, this puzzles me. When I try to install php-apcu from Remi's repos I get:

Code: Select all

Loaded plugins: fastestmirror, priorities
Loading mirror speeds from cached hostfile
 * base: centos.mirror.ca.planethoster.net
 * epel: mirror.csclub.uwaterloo.ca
 * extras: centos.mirror.ca.planethoster.net
 * remi-php71: remi.mirrors.arminco.com
 * remi-php71-test: remi.mirrors.arminco.com
 * remi-safe: remi.mirrors.arminco.com
 * updates: mirror.gpmidi.net
400 packages excluded due to repository priority protections
Resolving Dependencies
--> Running transaction check
---> Package php-pecl-apcu.x86_64 0:4.0.11-1.el7 will be installed
--> Processing Dependency: php(api) = 20100412-64 for package: php-pecl-apcu-4.0.11-1.el7.x86_64
--> Processing Dependency: php(zend-abi) = 20100525-64 for package: php-pecl-apcu-4.0.11-1.el7.x86_64
--> Finished Dependency Resolution
Error: Package: php-pecl-apcu-4.0.11-1.el7.x86_64 (epel)
           Requires: php(zend-abi) = 20100525-64
           Installed: php-common-7.1.12-4.el7.remi.x86_64 (@remi-php71)
               php(zend-abi) = 20160303-64
           Available: php-common-7.1.12-3.el7.remi.x86_64 (remi-php71)
               php(zend-abi) = 20160303-64
Error: Package: php-pecl-apcu-4.0.11-1.el7.x86_64 (epel)
           Requires: php(api) = 20100412-64
           Installed: php-common-7.1.12-4.el7.remi.x86_64 (@remi-php71)
               php(api) = 20160303-64
           Available: php-common-7.1.12-3.el7.remi.x86_64 (remi-php71)
               php(api) = 20160303-64
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest


My interpretation is that yum is trying to install a version of php-apcu which requires an older php(zend-abi) (20100525-64) than what is currently installed (20160303-64).

Is this because Remi's repo is bugged up or is it because I am doing something wrong?

The following REMI repos are enabled on my system:
[remi-php71]
[remi-safe]

lpallard
Posts: 50
Joined: 2014/09/17 02:39:48

Re: Possible PHP 7.1 bug or crash on Centos 7??

Postby lpallard » 2017/12/04 01:20:49

OK fixed it. Made Remi's PHP71 repo have a higher priority (more important) than EPEL. Now APCU installed!

The cloud is back in action and feels MUCH faster now!

Thanks guys!

grdt
Posts: 56
Joined: 2013/12/04 08:59:15

Re: Possible PHP 7.1 bug or crash on Centos 7??

Postby grdt » 2017/12/05 12:19:37

on Step 3, you do, Uninstall all PHP 5.4 packages, like - yum erase php*

is it necessary to do that or is it just a recommendation?

User avatar
TrevorH
Forum Moderator
Posts: 21161
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Possible PHP 7.1 bug or crash on Centos 7??

Postby TrevorH » 2017/12/05 13:24:50

If you use SCL packages then they are designed to install in parallel with the system php packages. If you use IUS/Remi or some other repo that provides replacement packages then you need to remove the distro packages first as the replacements will conflict with them and give errors when you try to install.
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

grdt
Posts: 56
Joined: 2013/12/04 08:59:15

Re: Possible PHP 7.1 bug or crash on Centos 7??

Postby grdt » 2017/12/05 13:55:53

ok, great I see

grdt
Posts: 56
Joined: 2013/12/04 08:59:15

Re: Possible PHP 7.1 bug or crash on Centos 7??

Postby grdt » 2017/12/05 15:47:30

though, it is not clear to me what version of 'php' that will
be installed, if go for the 'The SCL Repositories'
i.e. https://www.hogarthuk.com/?q=node/15 !?