我已经安装了 Apache2 和 PHP,如下所示:
sudo yum install -y httpd.x86_64
sudo amazon-linux-extras install php7.2
我找不到要在 Apache2 中加载的 libphp7.so 模块。我从 php 加载了 httpd_modules,但仍然找不到 .so。有什么建议吗?
$ sudo amazon-linux-extras install php7.2
Installing php-pdo, php-fpm, php-mysqlnd, php-cli, php-json
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
amzn2-core | 2.4 kB 00:00:00
amzn2extra-docker | 1.3 kB 00:00:00
amzn2extra-httpd_5f_modules | 1.3 kB 00:00:00
amzn2extra-php7.2 | 1.3 kB 00:00:00
Package php-cli-7.2.8-3.amzn2.0.2.x86_64 already installed and latest version
Package php-fpm-7.2.8-3.amzn2.0.2.x86_64 already installed and latest version
Package php-json-7.2.8-3.amzn2.0.2.x86_64 already installed and latest version
Package php-mysqlnd-7.2.8-3.amzn2.0.2.x86_64 already installed and latest version
Package php-pdo-7.2.8-3.amzn2.0.2.x86_64 already installed and latest version
Nothing to do
0 ansible2 available [ =2.4.2 =2.4.6 ]
1 emacs available [ =25.3 ]
2 httpd_modules=latest enabled [ =1.0 ]
3 memcached1.5 available [ =1.5.1 ]
4 nginx1.12 available [ =1.12.2 ]
5 postgresql9.6 available [ =9.6.6 =9.6.8 ]
6 postgresql10 available [ =10 ]
7 python3 available [ =3.6.2 ]
8 redis4.0 available [ =4.0.5 =4.0.10 ]
9 R3.4 available [ =3.4.3 ]
10 rust1 available \
[ =1.22.1 =1.26.0 =1.26.1 =1.27.2 ]
11 vim available [ =8.0 ]
12 golang1.9 available [ =1.9.2 ]
13 ruby2.4 available [ =2.4.2 =2.4.4 ]
14 nano available [ =2.9.1 ]
15 php7.2=latest enabled \
[ =7.2.0 =7.2.4 =7.2.5 =7.2.8 ]
16 lamp-mariadb10.2-php7.2 available \
[ =10.2.10_7.2.0 =10.2.10_7.2.4 =10.2.10_7.2.5
=10.2.10_7.2.8 ]
17 libreoffice available [ =5.0.6.2_15 ]
18 gimp available [ =2.8.22 ]
19 docker=latest enabled \
[ =17.12.1 =18.03.1 =18.06.1 ]
20 mate-desktop1.x available [ =1.19.0 =1.20.0 ]
21 GraphicsMagick1.3 available [ =1.3.29 ]
22 tomcat8.5 available [ =8.5.31 =8.5.32 ]
23 epel available [ =7.11 ]
答案1
我必须sudo yum install php
这样做之后才能够找到该模块。
[ec2-user@ip-10-10-22-236 ~]$ sudo find / -type f -name libphp7.so
/usr/lib64/httpd/modules/libphp7.so