Ask Your Question

How to get php to work via apache

asked 2017-10-06 19:54:22 +0000

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 ( 2017-10-07 02:08:29 +0000 )edit

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

ingli ( 2017-10-07 07:59:54 +0000 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2017-10-07 08:02:21 +0000

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

[hide preview]

Use your votes!

  • Use the 30 daily voting points that you get!
  • Up-vote well framed questions that provide enough information to enable people provide answers.
  • Thank your helpers by up-voting their comments and answers. If a question you asked has been answered, accept the best answer by clicking on the checkbox on the left side of the answer.
  • Down-voting might cost you karma, but you should consider doing so for incorrect or clearly detrimental questions and answers.

Question Tools

1 follower


Asked: 2017-10-06 19:54:22 +0000

Seen: 63 times

Last updated: Oct 07 '17