Ask Your Question

How to get php to work via apache

asked 2017-10-06 14:54:22 -0500

I run successfully apache and mysql. I can access my mysql server with phpMyAdmin. But a standard info.php under var/www/html does accessed via the browser on localhost/info.php does not show anything.

sorry if I miss something really obvious...

I checked out several setup suggestions for LAMP - they all include php-mysql. The latter seems to not be supported anymore. I would have thought that installing and enabling, starting httpd, mariadb should suffice in getting php to work. Probably I miss just a simple point?

edit retag flag offensive close merge delete



if you can work with phpMyAdmin then you already have php working on apache issue ls -laZ /var/ww/html to see if the file you added has seLinux permits to run from Apache. Place the output here.

aeperezt gravatar imageaeperezt ( 2017-10-06 21:08:29 -0500 )edit

thanks, your comment helped a lot. the seLinux was the issue. I was not aware of this before.

ingli gravatar imageingli ( 2017-10-07 02:59:54 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2017-10-07 03:02:21 -0500

I missed checking out seLinux.

Using ls -laZ /var/www/html I learned that the files in the html folder have not been set in the needed seLinux context.

Following helped me to set the required context. sudo chcon -Rv --type=httpd syscontent_t /var/www/html

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2017-10-06 14:54:22 -0500

Seen: 239 times

Last updated: Oct 07 '17