Ask Your Question
1

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

Comments

1

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
1

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 https://wiki.centos.org/HowTos/SELinux helped me to set the required context. sudo chcon -Rv --type=httpd syscontent_t /var/www/html

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

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

Seen: 121 times

Last updated: Oct 07 '17