note 103119 deleted from json.installation by danbrown
| From: | danbrown@php.net | Date: | Sun, 27 Mar 2011 01:32:24 +0000 |
| Subject: | note 103119 deleted from json.installation by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-178244@lists.php.net to get a copy of this message | ||
Note Submitter: Zeathe
----
A note for those who are actually using SELinux....
Per dmitryzayats:
|Installation steps on CentOs 5.3 include
|
|# yum install php-devel
|# yum install php-pear
|# yum install gcc
|# pear install pecl/json
|
|# cd /etc/php.d
|# echo "extension=json.so" > json.ini
|# service httpd restart
|
|After that phpinfo() would output
|
|json support enabled
|json version 1.2.1
This is not quite correct on SELinux enabled.
You must change the context of the json.so module for SELinux as it adopts the tmp_t context and
user-space User.... fix this simply by executing:
# chcon -u system_u -t textrel_shlib_t /usr/lib/php/modules/json.so
Otherwise...SELinux audit log will show something like:
type=AVC msg=audit(1301186547.574:24405): avc: denied { read } for pid=26998
comm="httpd" name="json.so" dev=dm-0 ino=28639463
scontext=user_u:system_r:httpd_t:s0 tcontext=user_u:object_r:tmp_t:s0 tclass=file
...and you will see json.ini being parsed and still not see the JSON info section in phpinfo()
output as PHP is being denied access to the module by SELinux.