PHP通过两种方式进行扩展应用
1.通过 .so进行配置
文件写在/usr/lib/2015XXX/,包含动态库文件。
2.通过 .dll进行配置
PHP越大越容易被弃用,在各种/etc/的php.ini中,去掉 “;” 代表使用dll文件。
这两种方法的目的都是为了引用库。
Apache2中PHP 7会和Flask的wsgi冲突
现象
在flask.py下可以正常调用mongodb数据库,在apache2会报错:
Segmentation Faults and “Truncated or oversized response headers received from daemon process”
经 https://github.com/GrahamDumpleton/mod_wsgi/issues/351 发现,PHP与flask会存在冲突,当php关闭后WSGI可以正常使用。
a2dismod php7.0 (apache2关闭模块命令)
其中有可能是214模块过多的问题:
php -m (查看模块)
222 | 214 |
---|---|
calendar | calendar |
Core | Core |
ctype | ctype |
curl | curl |
date | date |
dom | |
exif | exif |
fileinfo | fileinfo |
filter | filter |
ftp | ftp |
gd | gd |
gettext | gettext |
hash | hash |
iconv | iconv |
json | json |
libxml | libxml |
mbstring | mbstring |
mcrypt | |
mysqli | mysqli |
mysqlnd | mysqlnd |
openssl | openssl |
pcntl | pcntl |
pcre | pcre |
PDO | PDO |
pdo_mysql | pdo_mysql |
pdo_pgsql | |
pdo_sqlite | |
pgsql | |
Phar | Phar |
posix | posix |
readline | readline |
Reflection | Reflection |
session | session |
shmop | shmop |
SimpleXML | |
sockets | sockets |
SPL | SPL |
sqlite3 | |
standard | standard |
sysvmsg | sysvmsg |
sysvsem | sysvsem |
sysvshm | sysvshm |
tokenizer | tokenizer |
wddx | |
xml | |
xmlreader | |
xmlrpc | |
xmlwriter | |
xsl | |
Zend OPcache | Zend OPcache |
zlib | zlib |
补一个guolab方面的应用:和202相比就多一个xdebug。
php禁用多余模块
phpenmod–用于在php中启用模块
phpdismod–用于禁用php中的模块
phpquery–用于查看php模块的状态
可能会起到效果,需要重启验证。
PHP常见问题
1.如果卸载的是mod等文件,系统会报错,需要通过重启解决。
问题安装由来
[Tue Jun 15 18:45:23.101013 2021] [wsgi:error] [pid 2824] [{u'AA': u'0.74-0.8-0.99-0.83-0.98-0.98-1-0.84-0.79-0.74-1-0.73-0.82-1-0.81-0.83-0.87-0.99-0.96-0.65-0.73-1-0.67-0.74-0.79-0.78-0.79-1-0.65-0.69-0.99-1-0.71-0.7-0.8-0.73-0.75-0.8-0.7-0.77-0.78-0.81-0.77-0.74-0.74-0.76-0.8-1-0.87-0.9-0.83-0.75-0.97-0.96-1-0.82-0.79-0.75-1-0.74-0.8-0.85-0.8-0.65-0.79-0.88-0.64-0.96-0.86-0.99-1-0.65-0.75-0.7-1-0.84-0.86-0.83-0.81-0.6-0.77-0.91-0.97-0.73-0.9-0.64-0.64-0.73-0.8-0.7-0.86-0.98-0.79-0.73-0.92-0.88-0.98-1-0.73-0.7-0.78-1-0.81-0.93-0.76-0.88-0.85-0.65-1-0.87-0.91-0.95-1-0.78-0.81-0.7-0.89-0.76-0.94-0.98-0.79-1-0.72-0.71-0.92-0.82-0.78-0.89-0.9-0.95-0.81-0.82-0.97-0.8-0.75-0.72-0.75-0.65-0.77-0.76-0.73-0.81-0.78-0.7-0.7-0.86-0.76-0.8-0.66-0.76-0.76-0.74-0.88-0.64-0.85-0.83-0.73-0.75-0.82-1-1-0.9-0.79-0.77-1-0.82-0.7-0.82-0.76-0.69-0.75-0.75-0.78-0.66-0.68-1-1-0.97-1-0.75-0.67-0.72-0.71-0.7-0.68-0.83-0.72-0.95-0.72-0.64-0.66-1-0.82-1-1-0.82-0.75-0.85-0.69-0.68-0.91-0.87-1-0.73-0.67-0.79-0.85-0.88-0.83-0.69-0.91-0.89-0.4-0.74-0.93-1-0.63-0.59-0.77-0.84-0.8-0.71-0.69-0.78-0.77-1-0.94-0.8-0.93-0.8-0.79-0.93-0.79-1-0.96-0.89-0.81-0.9-0.81-0.74-0.78-0.8-0.8-0.85-0.76-0.83-0.7-0.78-0.87-0.74-0.71-0.83-0.85-0.83-0.74-1-0.8-0.82-0.79-0.82-0.73-0.63-0.98-0.94-0.77-0.93-0.72-0.95-0.81-0.95-0.77-0.89-0.64-0.8-0.92-0.97-0.97-0.71-0.62-0.83-0.89
Start-Date: 2021-06-15 23:39:21
Commandline: apt install php-mysql php-gd
Requested-By: yangyb (1001)
Install: php-mysql:amd64 (1:7.0+35ubuntu6.1)
End-Date: 2021-06-15 23:39:21
Start-Date: 2021-06-16 00:31:22
Commandline: apt-get remove php
Requested-By: yangyb (1001)
Remove: php:amd64 (1:7.0+35ubuntu6.1)
End-Date: 2021-06-16 00:31:22
Start-Date: 2021-06-16 00:35:43
Commandline: apt-get remove php7.0
Requested-By: yangyb (1001)
Remove: php7.0:amd64 (7.0.33-0ubuntu0.16.04.16)
End-Date: 2021-06-16 00:35:43
Start-Date: 2021-06-16 00:36:08
Commandline: apt-get install php7.0
Requested-By: yangyb (1001)
Install: php7.0:amd64 (7.0.33-0ubuntu0.16.04.16)
End-Date: 2021-06-16 00:36:09
Start-Date: 2021-06-16 00:38:34
Commandline: apt-get --reinstall install php-mysql
Requested-By: yangyb (1001)
Reinstall: php-mysql:amd64 (1:7.0+35ubuntu6.1)
End-Date: 2021-06-16 00:38:34
Start-Date: 2021-06-16 00:41:40
Commandline: apt-get autoremove php7*
Remove: php-gd:amd64 (1:7.0+35ubuntu6.1), javascript-common:amd64 (11), php-xml:amd64 (1:7.0+35ubuntu6.1), php7.0-cli:amd64 (7.0.33-0ubuntu0.16.04.16), php-ph
pseclib:amd64 (2.0.1-1build1), libapache2-mod-php:amd64 (1:7.0+35ubuntu6.1), php-common:amd64 (1:35ubuntu6.1), php7.0-fpm:amd64 (7.0.33-0ubuntu0.16.04.16), ph
p7.0-gd:amd64 (7.0.33-0ubuntu0.16.04.16), php7.0-opcache:amd64 (7.0.33-0ubuntu0.16.04.16), php7.0:amd64 (7.0.33-0ubuntu0.16.04.16), libjs-jquery:amd64 (1.11.3
+dfsg-4), php7.0-common:amd64 (7.0.33-0ubuntu0.16.04.16), libjs-underscore:amd64 (1.7.0~dfsg-1ubuntu1.1), php-mcrypt:amd64 (1:7.0+35ubuntu6.1), libmcrypt4:amd
64 (2.5.8-3.3), php-pear:amd64 (1:1.10.1+submodules+notgz-6ubuntu0.3), phpmyadmin:amd64 (4:4.5.4.1-2ubuntu2.1), dbconfig-mysql:amd64 (2.0.4ubuntu1), php7.0-js
on:amd64 (7.0.33-0ubuntu0.16.04.16), php-tcpdf:amd64 (6.0.093+dfsg-1ubuntu1), php7.0-mbstring:amd64 (7.0.33-0ubuntu0.16.04.16), php7.0-readline:amd64 (7.0.33-
0ubuntu0.16.04.16), php7.0-xml:amd64 (7.0.33-0ubuntu0.16.04.16), php7.0-mcrypt:amd64 (7.0.33-0ubuntu0.16.04.16), dbconfig-common:amd64 (2.0.4ubuntu1), php-mbs
tring:amd64 (1:7.0+35ubuntu6.1), php-gettext:amd64 (1.0.11-2build1), php-mysql:amd64 (1:7.0+35ubuntu6.1), libjs-sphinxdoc:amd64 (1.3.6-2ubuntu1.2), libapache2
-mod-php7.0:amd64 (7.0.33-0ubuntu0.16.04.16), php7.0-mysql:amd64 (7.0.33-0ubuntu0.16.04.16)
End-Date: 2021-06-16 00:43:03
Start-Date: 2021-06-16 00:43:59
Commandline: apt-get install php
Install: php7.0-cli:amd64 (7.0.33-0ubuntu0.16.04.16, automatic), php-common:amd64 (1:35ubuntu6.1, automatic), php7.0-fpm:amd64 (7.0.33-0ubuntu0.16.04.16, auto
matic), php7.0-opcache:amd64 (7.0.33-0ubuntu0.16.04.16, automatic), php7.0:amd64 (7.0.33-0ubuntu0.16.04.16, automatic), php7.0-common:amd64 (7.0.33-0ubuntu0.1
6.04.16, automatic), php:amd64 (1:7.0+35ubuntu6.1), php7.0-json:amd64 (7.0.33-0ubuntu0.16.04.16, automatic), php7.0-readline:amd64 (7.0.33-0ubuntu0.16.04.16,
automatic)
End-Date: 2021-06-16 00:44:05
Start-Date: 2021-06-16 00:44:53
Commandline: apt-get install libapache2-mod-php
Install: libapache2-mod-php:amd64 (1:7.0+35ubuntu6.1), libapache2-mod-php7.0:amd64 (7.0.33-0ubuntu0.16.04.16, automatic)
End-Date: 2021-06-16 00:44:58
Start-Date: 2021-06-16 00:45:06
Commandline: apt-get install php7.0-mysql
Install: php7.0-mysql:amd64 (7.0.33-0ubuntu0.16.04.16)
End-Date: 2021-06-16 00:45:07
Start-Date: 2021-06-16 00:50:51
Commandline: apt-get install phpmyadmin
Requested-By: yangyb (1001)
Install: php-gd:amd64 (1:7.0+35ubuntu6.1, automatic), javascript-common:amd64 (11, automatic), php-xml:amd64 (1:7.0+35ubuntu6.1, automatic), php-phpseclib:amd
64 (2.0.1-1build1, automatic), php7.0-gd:amd64 (7.0.33-0ubuntu0.16.04.16, automatic), libjs-jquery:amd64 (1.11.3+dfsg-4, automatic), libjs-underscore:amd64 (1
.7.0~dfsg-1ubuntu1.1, automatic), php-mcrypt:amd64 (1:7.0+35ubuntu6.1, automatic), libmcrypt4:amd64 (2.5.8-3.3, automatic), php-pear:amd64 (1:1.10.1+submodule
s+notgz-6ubuntu0.3, automatic), phpmyadmin:amd64 (4:4.5.4.1-2ubuntu2.1), dbconfig-mysql:amd64 (2.0.4ubuntu1, automatic), php-tcpdf:amd64 (6.0.093+dfsg-1ubuntu
1, automatic), php7.0-mbstring:amd64 (7.0.33-0ubuntu0.16.04.16, automatic), php7.0-xml:amd64 (7.0.33-0ubuntu0.16.04.16, automatic), php7.0-mcrypt:amd64 (7.0.3
3-0ubuntu0.16.04.16, automatic), dbconfig-common:amd64 (2.0.4ubuntu1, automatic), php-mbstring:amd64 (1:7.0+35ubuntu6.1, automatic), php-gettext:amd64 (1.0.11
-2build1, automatic), libjs-sphinxdoc:amd64 (1.3.6-2ubuntu1.2, automatic)
End-Date: 2021-06-16 00:50:57
Start-Date: 2021-06-16 01:38:40
Commandline: apt-get install php7.0-fpm php7.0-mysql php7.0-common php7.0-mbstring php7.0-gd php7.0-json php7.0-cli php7.0-curl libapache2-mod-php7.0
Install: php7.0-curl:amd64 (7.0.33-0ubuntu0.16.04.16)
End-Date: 2021-06-16 01:38:41
Start-Date: 2021-06-16 01:51:34
Commandline: apt-get install php-mbstring php-mysqli php-pdo-mysql php-pdo-sqlite php-pgsql php-xmlrpc
Install: php7.0-xmlrpc:amd64 (7.0.33-0ubuntu0.16.04.16, automatic), php7.0-sqlite3:amd64 (7.0.33-0ubuntu0.16.04.16), libpq5:amd64 (9.5.25-0ubuntu0.16.04.1, au
tomatic), php-pgsql:amd64 (1:7.0+35ubuntu6.1), php7.0-pgsql:amd64 (7.0.33-0ubuntu0.16.04.16, automatic), php-xmlrpc:amd64 (1:7.0+35ubuntu6.1), libxmlrpc-epi0:
amd64 (0.54.2-1.1ubuntu0.1, automatic)
End-Date: 2021-06-16 01:51:35
Start-Date: 2021-06-16 01:58:38
Commandline: apt-get install php-mysql
Requested-By: yangyb (1001)
Install: php-mysql:amd64 (1:7.0+35ubuntu6.1)
[Wed Jun 16 02:31:59.088541 2021] [mpm_prefork:notice] [pid 434111] AH00169: caught SIGTERM, shutting down
[Wed Jun 16 02:32:00.500128 2021] [mpm_prefork:notice] [pid 434407] AH00163: Apache/2.4.18 (Ubuntu) mod_wsgi/4.3.0 Python/2.7.12 configured -- resuming normal operations
[Wed Jun 16 02:32:00.500168 2021] [core:notice] [pid 434407] AH00094: Command line: '/usr/sbin/apache2'
[Wed Jun 16 02:45:24.781221 2021] [access_compat:error] [pid 434414] [client 192.35.168.16:55392] AH01797: client denied by server configuration: /var/www/html/
[Wed Jun 16 03:26:28.996451 2021] [access_compat:error] [pid 434416] [client 162.221.192.26:60062] AH01797: client denied by server configuration: /var/www/html/
[Wed Jun 16 04:29:17.129795 2021] [wsgi:error] [pid 8556] [client 66.249.65.41:57493] Truncated or oversized response headers received from daemon process 'Animal_ImputeDB': /home/yangyb/imputeDB/Animal_imputeDB/imputeDB/wsgi.py, referer: http://gong_lab.hzau.edu.cn/Animal_ImputeDB
[Wed Jun 16 04:29:17.593243 2021] [core:notice] [pid 434407] AH00052: child pid 434412 exit signal Segmentation fault (11)
[Wed Jun 16 04:29:18.086371 2021] [wsgi:error] [pid 8557] [client 66.249.65.36:60825] Truncated or oversized response headers received from daemon process 'Animal_ImputeDB': /home/yangyb/imputeDB/Animal_imputeDB/imputeDB/wsgi.py, referer: http://gong_lab.hzau.edu.cn/Animal_ImputeDB
[Wed Jun 16 04:29:18.595355 2021] [core:notice] [pid 434407] AH00052: child pid 17615 exit signal Segmentation fault (11)
[Wed Jun 16 05:11:07.156333 2021] [access_compat:error] [pid 8558] [client 128.14.209.162:59906] AH01797: client denied by server configuration: /var/www/html/
[Wed Jun 16 05:18:30.608258 2021] [access_compat:error] [pid 434415] [client 188.191.144.128:41149] AH01797: client denied by server configuration: /var/www/html/
[Wed Jun 16 05:31:29.609212 2021] [wsgi:error] [pid 434411] {'apa_probe': None, 'gene': '', 'snp': 'rs8736\\nrs641738