PHP not work on Centos 7

General support questions
ymmij
Posts: 3
Joined: 2017/10/17 07:01:04

PHP not work on Centos 7

Postby ymmij » 2017/10/17 07:05:40

--INFO--
php version: PHP 5.4.16 (cli) (built: Nov 6 2016 00:29:02)
httpd version: Server version: Apache/2.4.6 (CentOS)

I can't run any php file on my web server, the result only shows blank page or 404 not found page, thank you very much for community willingness to help me
Last edited by ymmij on 2017/10/18 03:48:37, edited 1 time in total.

User avatar
avij
Forum Moderator
Posts: 2141
Joined: 2010/12/01 19:25:52
Location: Helsinki, Finland
Contact:

Re: PHP not work on Centos 7

Postby avij » 2017/10/17 08:01:57

See if there's anything interesting in /var/log/httpd/error_log

User avatar
TrevorH
Forum Moderator
Posts: 21018
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: PHP not work on Centos 7

Postby TrevorH » 2017/10/17 09:11:58

Did you move your docroot away from the default location?
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

ymmij
Posts: 3
Joined: 2017/10/17 07:01:04

Re: PHP not work on Centos 7

Postby ymmij » 2017/10/18 03:30:35

TrevorH wrote:Did you move your docroot away from the default location?


No sir/ma'am, when i put .html file on /var/www/html it works but not with .php file

ymmij
Posts: 3
Joined: 2017/10/17 07:01:04

Re: PHP not work on Centos 7

Postby ymmij » 2017/10/18 03:46:06

avij wrote:See if there's anything interesting in /var/log/httpd/error_log


Code: Select all

[Tue Oct 17 23:20:59.779750 2017] [core:notice] [pid 31790] SELinux policy enabled; httpd running as context system_u:system_r:httpd_t:s0
[Tue Oct 17 23:20:59.780308 2017] [suexec:notice] [pid 31790] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain. Set the 'ServerName' directive globally to suppress this message
[Tue Oct 17 23:20:59.793452 2017] [auth_digest:notice] [pid 31790] AH01757: generating secret for digest authentication ...
[Tue Oct 17 23:20:59.794096 2017] [lbmethod_heartbeat:notice] [pid 31790] AH02282: No slotmem from mod_heartmonitor
[Tue Oct 17 23:20:59.846423 2017] [mpm_prefork:notice] [pid 31790] AH00163: Apache/2.4.6 () PHP/5.4.16 configured -- resuming normal operations
[Tue Oct 17 23:20:59.846439 2017] [core:notice] [pid 31790] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
[Tue Oct 17 23:21:10.947825 2017] [autoindex:error] [pid 31791] [client ::1:46850] AH01276: Cannot serve directory /var/www/html/: No matching DirectoryIndex (index.html,index.php) found, and server-generated directory index forbidden by Options directive
[Tue Oct 17 23:35:46.308125 2017] [mpm_prefork:notice] [pid 31790] AH00170: caught SIGWINCH, shutting down gracefully
[Tue Oct 17 23:35:47.354365 2017] [core:notice] [pid 32423] SELinux policy enabled; httpd running as context system_u:system_r:httpd_t:s0
[Tue Oct 17 23:35:47.354907 2017] [suexec:notice] [pid 32423] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain. Set the 'ServerName' directive globally to suppress this message
[Tue Oct 17 23:35:47.366632 2017] [auth_digest:notice] [pid 32423] AH01757: generating secret for digest authentication ...
[Tue Oct 17 23:35:47.367254 2017] [lbmethod_heartbeat:notice] [pid 32423] AH02282: No slotmem from mod_heartmonitor
[Tue Oct 17 23:35:47.376468 2017] [mpm_prefork:notice] [pid 32423] AH00163: Apache/2.4.6 () PHP/5.4.16 configured -- resuming normal operations
[Tue Oct 17 23:35:47.376482 2017] [core:notice] [pid 32423] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
[Tue Oct 17 23:44:18.983185 2017] [mpm_prefork:notice] [pid 32423] AH00170: caught SIGWINCH, shutting down gracefully
[Tue Oct 17 23:44:20.030578 2017] [core:notice] [pid 32592] SELinux policy enabled; httpd running as context system_u:system_r:httpd_t:s0
[Tue Oct 17 23:44:20.031234 2017] [suexec:notice] [pid 32592] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Tue Oct 17 23:44:20.044825 2017] [auth_digest:notice] [pid 32592] AH01757: generating secret for digest authentication ...
[Tue Oct 17 23:44:20.045393 2017] [lbmethod_heartbeat:notice] [pid 32592] AH02282: No slotmem from mod_heartmonitor
[Tue Oct 17 23:44:20.054621 2017] [mpm_prefork:notice] [pid 32592] AH00163: Apache/2.4.6 () PHP/5.4.16 configured -- resuming normal operations
[Tue Oct 17 23:44:20.054640 2017] [core:notice] [pid 32592] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'