I already installed Apache 2.4 and PHP 7.4 on Centos 8, which is running on Google Cloud Platform.
Apache:
● httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor preset: disabled)
Drop-In: /usr/lib/systemd/system/httpd.service.d
└─php-fpm.conf, php74-php-fpm.conf
Active: active (running) since Wed 2020-07-29 07:55:37 UTC; 41min ago
Docs: man:httpd.service(8)
Main PID: 20366 (httpd)
Status: "Total requests: 19; Idle/Busy workers 100/0;Requests/sec: 0.0076; Bytes served/sec: 63 B/sec"
Tasks: 278 (limit: 9312)
Memory: 35.4M
CGroup: /system.slice/httpd.service
├─20366 /usr/sbin/httpd -DFOREGROUND
├─20368 /usr/sbin/httpd -DFOREGROUND
├─20369 /usr/sbin/httpd -DFOREGROUND
├─20370 /usr/sbin/httpd -DFOREGROUND
├─20371 /usr/sbin/httpd -DFOREGROUND
└─20583 /usr/sbin/httpd -DFOREGROUND
Jul 29 07:55:37 test-app-devel1 systemd[1]: Stopped The Apache HTTP Server.
Jul 29 07:55:37 test-app-devel1 systemd[1]: Starting The Apache HTTP Server...
Jul 29 07:55:37 test-app-devel1 systemd[1]: Started The Apache HTTP Server.
Jul 29 07:55:37 test-app-devel1 httpd[20366]: Server configured, listening on: port 443, port 80
PHP:
php --version
PHP 7.4.8 (cli) (built: Jul 9 2020 08:57:23) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.8, Copyright (c), by Zend Technologies
Running PHP scripts directly using php
command works fine. The problem is cannot execute PHP file via browser. I got this 503 error:
Service Unavailable The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.
There are a few current entries from the apache log:
xxx.xxx.xxx.xxx - - [29/Jul/2020:08:15:17 +0000] "GET /test.txt HTTP/1.1" 304 - "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.105 Safari/537.36"
xxx.xxx.xxx.xxx - - [29/Jul/2020:08:15:19 +0000] "GET /test.txt HTTP/1.1" 304 - "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.105 Safari/537.36"
xxx.xxx.xxx.xxx - - [29/Jul/2020:08:15:32 +0000] "GET /ASF20thAnniversary.jpg HTTP/1.1" 200 72242 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.105 Safari/537.36"
xxx.xxx.xxx.xxx - - [29/Jul/2020:08:15:41 +0000] "GET /phpinfo.php HTTP/1.1" 503 299 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.105 Safari/537.36"
xxx.xxx.xxx.xxx - - [29/Jul/2020:08:16:01 +0000] "-" 408 - "-" "-"
Both txt and jpg files are loaded properly. But not the php file. How to fix this?
0 Answers