/usr/bin/php: error while loading shared libraries: libselinux.so.1

While enabling PHP SuPHP handler  on one of my server, I  started to get 500 Internal Server Error for all php pages .

So, my initial reaction  was to check  the Permissions and Ownerships for all PHP  files as while enabling PHP SuPHP  the max file permissions should be 644 and max folder permissions should be 755 and all  php files should ran under the ownership of user.user instead of apache.apache.

Also, I have checked all .htaccess files to see any one of the contains PHP flags like php_flag or php_admin_value as while enabling PHP SuPHP all PHP flags defined under .htaccess files will  result in a   500 Internal Server Error .

But after checking all the above, I  started to wonder as to what it could be  and then I realized  that it could be the RLimitMEM and RLimitCPU defined in the httpd.conf file and after disabling those values all the PHP  pages started to  work like a charm. 

So, if anyone come across this issue then follow the below steps to resolve the issue :


Open  the httpd.conf file


[email protected][#] vi /etc/httpd/conf/httpd.conf

and search  for lines

RLimitMEM 116574208
RLimitCPU 240

and comment those lines as

#RLimitMEM 116574208
#RLimitCPU 240

save and quit.  

finally restart apache service

[email protected][#] /etc/init.d/httpd restart

That’s all you are done.