Selinux issues and php5.4

selinux
php

#1

I'm Running RHEL 6.3. I've just followed the suggested instructions for install php54, which seems to have occurred successfully. However, yum is still saying there are more dependencies to resolve before I upgrade ownCloud (I'm still running 7.x want to upgrade to 8.x).
Anyway, when I try to get to the phpinfo.php page, I'm getting the following error messages in my apache log:
[Fri Aug 19 16:38:06 2016] [error] [client 128.186.138.248] PHP Warning: Unknown: failed to open stream: Permission denied in Unknown on line 0
[Fri Aug 19 16:38:06 2016] [error] [client 128.186.138.248] PHP Fatal error: Unknown: Failed opening required '/var/www/http_docs/index1.php' (include_path='.:/opt/rh/php54/root/usr/share/pear:/opt/rh/php54/root/usr/share/php') in Unknown on line 0

I rather suspect that it is an selinux issue and I need to give extra permissions to some file someplace (maybe in the /opt/rh/php54 tree). Has anybody else found/fixed this problem?

Steps to reproduce
1. Installed php 5.4 using instructions on server installation page
2. Set up phpinfo test page
3. Access phpinfo test page from browser.

Expected behaviour
I should get a wonderfully formatted message telling me that Apache is using php 5.4

Actual behaviour
I get a blank page and the following messages in the error log:
[Fri Aug 19 16:38:06 2016] [error] [client 128.186.138.248] PHP Warning: Unknown: failed to open stream: Permission denied in Unknown on line 0
[Fri Aug 19 16:38:06 2016] [error] [client 128.186.138.248] PHP Fatal error: Unknown: Failed opening required '/var/www/http_docs/index1.php' (include_path='.:/opt/rh/php54/root/usr/share/pear:/opt/rh/php54/root/usr/share/php') in Unknown on line 0

(index1.php the URL of the test page).

Server configuration
Operating system: RHEL 6.3
Web server:
Database: SQLite
PHP version: 5.4 (5.3 also installed)
ownCloud version (see ownCloud admin page): 7.0.4
Updated from an older ownCloud or fresh install: Fresh install (trying to upgrade to 8.2.1
ownCloud log (data/owncloud.log, see https://central.owncloud.org/t/how-to-find-webserver-or-oc-logfile-enable-php-logfile/808):

Special configuration (external storage, external authentication, reverse proxy, server-side-encryption):

Integrity status for oC9+

Login as admin user into your ownCloud and access
http://example.com/index.php/settings/integrity/failed
paste the results here.

#2

You can try to disable open_basedir() (->php.ini) and SELinux temporarily.

The RHEL/CentOS community has more experts regarding such questions.


#3

It was mostly a case of brain freeze on my part.
The problem was that I had the wrong permissions (000 instead of 644 on index1.php).

So I've properly done the php 5.4 install, but yum still does not recognize the newer installed version.


#4

Okay. I still have problems. I have successfully installed PHP 5.4 on my system and can verify that through php-info. Here is the output from yum:
sudo yum list installed | fgrep php54
php54.x86_64 2.0-1.el6 @rhel-x86_64-server-6-rhscl-1
php54-apc-panel.noarch 3.1.15-0.4.20130912.el6 @rhel-x86_64-server-6-rhscl-1
php54-php.x86_64 5.4.40-4.el6 @rhel-x86_64-server-6-rhscl-1
php54-php-bcmath.x86_64 5.4.40-4.el6 @rhel-x86_64-server-6-rhscl-1
php54-php-cli.x86_64 5.4.40-4.el6 @rhel-x86_64-server-6-rhscl-1
php54-php-common.x86_64 5.4.40-4.el6 @rhel-x86_64-server-6-rhscl-1
php54-php-dba.x86_64 5.4.40-4.el6 @rhel-x86_64-server-6-rhscl-1
php54-php-devel.x86_64 5.4.40-4.el6 @rhel-x86_64-server-6-rhscl-1
php54-php-gd.x86_64 5.4.40-4.el6 @rhel-x86_64-server-6-rhscl-1
php54-php-ldap.x86_64 5.4.40-4.el6 @rhel-x86_64-server-6-rhscl-1
php54-php-mbstring.x86_64 5.4.40-4.el6 @rhel-x86_64-server-6-rhscl-1
php54-php-mysqlnd.x86_64 5.4.40-4.el6 @rhel-x86_64-server-6-rhscl-1
php54-php-odbc.x86_64 5.4.40-4.el6 @rhel-x86_64-server-6-rhscl-1
php54-php-pdo.x86_64 5.4.40-4.el6 @rhel-x86_64-server-6-rhscl-1
php54-php-pear.noarch 1:1.9.4-10.el6 @rhel-x86_64-server-6-rhscl-1
php54-php-pecl-apc.x86_64 3.1.15-0.4.20130912.el6 @rhel-x86_64-server-6-rhscl-1
php54-php-pgsql.x86_64 5.4.40-4.el6 @rhel-x86_64-server-6-rhscl-1
php54-php-process.x86_64 5.4.40-4.el6 @rhel-x86_64-server-6-rhscl-1
php54-php-recode.x86_64 5.4.40-4.el6 @rhel-x86_64-server-6-rhscl-1
php54-php-soap.x86_64 5.4.40-4.el6 @rhel-x86_64-server-6-rhscl-1
php54-php-xml.x86_64 5.4.40-4.el6 @rhel-x86_64-server-6-rhscl-1
php54-runtime.x86_64 2.0-1.el6 @rhel-x86_64-server-6-rhscl-1

But I can't get yum to recognize that this resolve the dependency issue:

$ sudo yum update 
Loaded plugins: product-id, refresh-packagekit, rhnplugin, search-disabled-repos, security,
              : subscription-manager
This system is receiving updates from RHN Classic or RHN Satellite.
Setting up Update Process
Resolving Dependencies
--> Running transaction check
---> Package owncloud.noarch 0:7.0.4-17.1 will be obsoleted
---> Package owncloud-3rdparty.noarch 0:7.0.4-17.1 will be obsoleted
---> Package owncloud-config-apache.noarch 0:8.1.9-12.1 will be obsoleting
---> Package owncloud-server.noarch 0:8.1.9-12.1 will be obsoleting
--> Processing Dependency: php >= 5.4.0 for package: owncloud-server-8.1.9-12.1.noarch
--> Finished Dependency Resolution
Error: Package: owncloud-server-8.1.9-12.1.noarch (isv_ownCloud_community)
           Requires: php >= 5.4.0
           Installed: php-5.3.3-48.el6_8.x86_64 (@rhel-x86_64-server-6)
               php = 5.3.3-48.el6_8
           Available: php-5.3.2-6.el6.x86_64 (rhel-x86_64-server-6)
               php = 5.3.2-6.el6
           Available: php-5.3.2-6.el6_0.1.x86_64 (rhel-x86_64-server-6)
               php = 5.3.2-6.el6_0.1
           Available: php-5.3.3-3.el6.x86_64 (rhel-x86_64-server-6)
               php = 5.3.3-3.el6
           Available: php-5.3.3-3.el6_1.3.x86_64 (rhel-x86_64-server-6)
               php = 5.3.3-3.el6_1.3
           Available: php-5.3.3-3.el6_2.5.x86_64 (rhel-x86_64-server-6)
               php = 5.3.3-3.el6_2.5
           Available: php-5.3.3-3.el6_2.6.x86_64 (rhel-x86_64-server-6)
               php = 5.3.3-3.el6_2.6
           Available: php-5.3.3-3.el6_2.8.x86_64 (rhel-x86_64-server-6)
               php = 5.3.3-3.el6_2.8
           Available: php-5.3.3-14.el6_3.x86_64 (rhel-x86_64-server-6)
               php = 5.3.3-14.el6_3
           Available: php-5.3.3-22.el6.x86_64 (rhel-x86_64-server-6)
               php = 5.3.3-22.el6
           Available: php-5.3.3-23.el6_4.x86_64 (rhel-x86_64-server-6)
               php = 5.3.3-23.el6_4
           Available: php-5.3.3-26.el6.x86_64 (rhel-x86_64-server-6)
               php = 5.3.3-26.el6
           Available: php-5.3.3-27.el6_5.x86_64 (rhel-x86_64-server-6)
               php = 5.3.3-27.el6_5
           Available: php-5.3.3-27.el6_5.1.x86_64 (rhel-x86_64-server-6)
               php = 5.3.3-27.el6_5.1
           Available: php-5.3.3-27.el6_5.2.x86_64 (rhel-x86_64-server-6)
               php = 5.3.3-27.el6_5.2
           Available: php-5.3.3-38.el6.x86_64 (rhel-x86_64-server-6)
               php = 5.3.3-38.el6
           Available: php-5.3.3-40.el6_6.x86_64 (rhel-x86_64-server-6)
               php = 5.3.3-40.el6_6
           Available: php-5.3.3-46.el6_6.x86_64 (rhel-x86_64-server-6)
               php = 5.3.3-46.el6_6
           Available: php-5.3.3-46.el6_7.1.x86_64 (rhel-x86_64-server-6)
               php = 5.3.3-46.el6_7.1
           Available: php-5.3.3-47.el6.x86_64 (rhel-x86_64-server-6)
               php = 5.3.3-47.el6
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

The last two are of no help. The first simply skips updating ownCloud and the second does nothing. Somehow I need to tell yum that php54 resolves the dependency, but I can't figure out how.

Once again, any advice would be appreciated.


#5

Please create a new thread for the reasons explained here:


#6