You wouldn't be surprised if the screen became a GUI! If you think about it, there are many other surprises.
I thought that php was not included, so I added php -v with half a prank. It was as expected until "Command not found ...". What! After that, he asked me, "Do you want to install it?" I'm going to put in a "y". Unu, a message that misleads people. This is the spirited "y"! When asked for the administrator password, I'm a little withered. It seems that something was done. Try putting php -v again. It's done. seriously.
Let's get on with it and set up apache as it is. Try entering httpd -v as in php. Sure enough, I was asked if I would like to install it. It seems that it will install quite a lot. Also put y in the spirit here. The administrator password input screen appears, so try entering it. It seems that it was installed. Try putting systemctl. The status is displayed. It seems that they even registered the service. I will start it by the way. By the way, when exiting the command, enter q. Administrator password. I'm asked a little. I should have done sushi. After entering the password, check the status. It is running properly. When I launched FireFox of centos8 and accessed localhost, the top page of apache was displayed. Usha! Set so that it can be viewed from the host PC. The firewall seems to be useless unless it is changed with a command. Open http. Now you can see centos8 apache from the host OS.
Try setting php in apache with this flow. I'd like to create phpinfo.php in / var / www / html for the time being. Since it's a big deal, let's make it with a text editor using GUI. Open the right menu in the activity and click on the application. Click "All" below. Only "Text ..." is displayed, but click this to open a text editor. Prepare phpinfo with a text editor. Save this as phpinfo.php in / var / www / html. Click "+ Other location" to display frequently used folders on linux. Click on computer Various familiar folder names are displayed, so follow to / var / www / html. Save as phpinfo.php. I was told I wasn't authorized. Hey. It can't be helped, so save it in your own folder. Then copy it to / var / www / html with the command. If you think, you can't input Japanese. For the time being, after installing ibas, it can be installed. I referred to this site. Thank you very much. It may be better to restart after installing ibus. It's inconvenient for linux that you can't cd if you can't enter Japanese ... Now you have phpinfo. For the time being, try accessing localhost / phpinfo.php with FireFox of centos8.
Well, that's right. I haven't done anything. Now let's put php in apache. I used to set the php module in httpd.conf, but it's different from centos8. If you run php-fpm, it will connect. What the hell is that? For the time being, try running php-fpm as it is said.
[root@localhost ~]# systemctl start php-fpm
Failed to start php-fpm.service: Unit php-fpm.service not found.
There isn't. Also try -v as usual.
[root@localhost ~]# php-fpm -v
bash: php-fpm:The command was not found...
Command php-fpm'Package to provide'php-fpm'Do you want to install? [N/y]
You see. y Let's go.
[root@localhost ~]# php-fpm -v
bash: php-fpm:The command was not found...
Command php-fpm'Package to provide'php-fpm'Do you want to install? [N/y] y
*Waiting in the queue...
*Loading the list of packages....
The following packages should be installed:
nginx-filesystem-1:1.14.1-9.module_el8.0.0+184+e34fea82.noarch The basic directory layout for the Nginx server
php-fpm-7.2.24-1.module_el8.2.0+313+b04d0a66.x86_64 PHP FastCGI Process Manager
Do you want to continue with the changes?
Okay, this is also y.
[root@localhost ~]# php-fpm -v
bash: php-fpm:The command was not found...
Command php-fpm'Package to provide'php-fpm'Do you want to install? [N/y] y
*Waiting in the queue...
*Loading the list of packages....
The following packages should be installed:
nginx-filesystem-1:1.14.1-9.module_el8.0.0+184+e34fea82.noarch The basic directory layout for the Nginx server
php-fpm-7.2.24-1.module_el8.2.0+313+b04d0a66.x86_64 PHP FastCGI Process Manager
Do you want to continue with the changes?[N/y] y
*Waiting in the queue...
*Waiting for certification...
*Waiting in the queue...
*Downloading package...
*Requesting data...
*Testing changes...
*Installing the package...
PHP: syntax error, unexpected '&' in /etc/php.ini on line 107
PHP 7.2.24 (fpm-fcgi) (built: Oct 22 2019 08:28:36)
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
It is said that there is a syntax error, but I will start it for the time being.
[root@localhost ~]# systemctl start php-fpm
[root@localhost ~]# systemctl status php-fpm
● php-fpm.service - The PHP FastCGI Process Manager
Loaded: loaded (/usr/lib/systemd/system/php-fpm.service; disabled; vendor pr>
Active: active (running) since Sat 2020-06-27 08:47:16 EDT; 6s ago
Main PID: 3415 (php-fpm)
Status: "Ready to handle connections"
Tasks: 6 (limit: 11324)
Memory: 6.8M
CGroup: /system.slice/php-fpm.service
tq3415 php-fpm: master process (/etc/php-fpm.conf)
tq3416 php-fpm: pool www
tq3417 php-fpm: pool www
tq3418 php-fpm: pool www
tq3419 php-fpm: pool www
mq3420 php-fpm: pool www
June 27 08:47:16 localhost.localdomain systemd[1]: Starting The PHP FastCGI Pro>
June 27 08:47:16 localhost.localdomain php-fpm[3415]: PHP: syntax error, unexp>
June 27 08:47:16 localhost.localdomain systemd[1]: Started The PHP FastCGI Proc>
It seems to have moved. Try running httpd as well.
[root@localhost ~]# systemctl start httpd
[root@localhost ~]# systemctl status httpd
● httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor pres>
Drop-In: /usr/lib/systemd/system/httpd.service.d
mqphp-fpm.conf
Active: active (running) since Sat 2020-06-27 08:49:03 EDT; 4s ago
Docs: man:httpd.service(8)
Main PID: 3747 (httpd)
Status: "Started, listening on: port 80"
Tasks: 213 (limit: 11324)
Memory: 21.5M
CGroup: /system.slice/httpd.service
tq3747 /usr/sbin/httpd -DFOREGROUND
tq3748 /usr/sbin/httpd -DFOREGROUND
tq3749 /usr/sbin/httpd -DFOREGROUND
tq3750 /usr/sbin/httpd -DFOREGROUND
mq3751 /usr/sbin/httpd -DFOREGROUND
June 27 08:49:03 localhost.localdomain systemd[1]: Starting The Apache HTTP Ser>
June 27 08:49:03 localhost.localdomain httpd[3747]: AH00558: httpd: Could not r>
June 27 08:49:03 localhost.localdomain systemd[1]: Started The Apache HTTP Serv>
June 27 08:49:03 localhost.localdomain httpd[3747]: Server configured, listenin>
It seems to have moved. Try accessing phpinfo again with FireFox in centos8. It's done, it's done! I didn't write anything in the config file and php worked. Just in case, try accessing from the host OS as well. I saw it. No, it's unusually easy compared to now, centos8! If this is the case, you can easily launch apache.
Recommended Posts