我在 FreeBSD(FAMP 堆栈)上运行 Apache 2.4,并让 Wordpress 成功托管了一个网站。但是我最近尝试安装 phpLDAPadmin 以管理 LDAP 服务器,现在每当 Apache 运行时,我网站上的任何页面都会显示以下内容:
致命错误:未捕获错误:调用 /usr/local/www/apache24/data/wp-includes/wp-db.php:1643 中未定义的函数 mysql_connect() 堆栈跟踪:#0 /usr/local/www/apache24/数据/wp-includes/wp-db.php(639): wpdb->db_connect() #1 /usr/local/www/apache24/data/wp-includes/load.php(427): wpdb->__construct( 'user', 'pass', 'wordpressdb', 'localhost') #2 /usr/local/www/apache24/data/wp-settings.php(120): require_wp_db() #3 /usr/local/www/ apache24/data/wp-config.php(92): require_once('/usr/local/www/...') #4 /usr/local/www/apache24/data/wp-load.php(37): require_once('/usr/local/www/...') #5 /usr/local/www/apache24/data/wp-blog-header.php(13): require_once('/usr/local/www/. ..') #6 /usr/local/www/apache24/data/index.php(17): require('/usr/local/www/...') #7 {main} 在第 1643 行的 /usr/local/www/apache24/data/wp-includes/wp-db.php 中抛出
该网站遇到了技术难题。
此外,当我去检查 php 的版本时,会发生这种情况:
# php --version
Segmentation fault (core dumped)
我读到将 php 从 5.x 升级到 7.x 时可能会发生这种情况,但除非安装 phpLDAPadmin 执行升级,否则我相信我一直拥有 php 7.2。我能够看到 php 的手册页显示版本 7.2.21。虽然问题似乎与 php 有关,但我无法弄清楚到底发生了什么。我什至无法在命令行中检查 php 版本,这似乎非常奇怪。
我尝试过重新启动,以及通过 freebsd-update 和 portsnap 进行更新,然后重新安装,更不用说对 php.ini、wp-config.php 和 httpd.conf 的各种配置更改了。
====编辑====
我跑了pkg upgrade -f
,做了以下更改:
Installed packages to be UPGRADED:
py27-openssl: 18.0.0 - 19.0.0
openldap-server: 2.4.47_1 - 2.4.48
openldap-client: 2.4.47 - 2.4.48
mysql56-server: 5.6.44 - 5.6.45
mysql56-client: 5.6.44 - 5.6.45
libnghttp2: 1.39.1 - 1.39.2
apache24: 2.4.39_1 - 2.4.41
Installed packages to be DOWNGRADED:
postgresql95-client: 9.5.18_1 - 9.5.18
postfix: 3.4.6,1 - 3.4.5,1
Installed packages to be REINSTALLED:
pkg-1.11.1
zstd-1.4.0
zip-3.0_1
xtrans-1.4.0
xorgproto-2019.1
xorg-macros-1.19.2
xmlcharent-0.3_2
xmlcatmgr-2.2_2
xcb-proto-1.13_1
xauth-1.0.10
tor-0.4.0.5_1
texinfo-6.6_1,1
swig30-3.0.12
sdocbook-xml-1.1_2,2
scons-3.0.1
rhash-1.3.5
readline-8.0.0
python36-3.6.9
python27-2.7.16_1
py27-zope.interface-4.6.0
py27-zope.event-4.1.0
py27-zope.component-4.2.2
py27-urllib3-1.22,1
py27-typing-3.6.6
py27-sphinxcontrib-websupport-1.1.2
py27-sphinx_rtd_theme-0.4.3
py27-sphinx-1.6.5_2,1
py27-snowballstemmer-1.2.0_1
py27-six-1.12.0
py27-setuptools_scm-3.3.3
py27-setuptools-41.0.1
py27-requests-toolbelt-0.8.0
py27-requests-2.21.0
py27-pytz-2019.1,1
py27-pytest-runner-2.11.1
py27-pystemmer-1.3.0_2
py27-pysocks-1.7.0
py27-pyrfc3339-1.1
py27-pygments-2.4.1
py27-pycparser-2.19
py27-parsedatetime-2.4_1
py27-josepy-1.2.0
py27-ipaddress-1.0.22
py27-imagesize-0.7.1
py27-idna-2.8
py27-enum34-1.1.6
py27-docutils-0.14_4
py27-cryptography-2.6.1
py27-configobj-5.0.6_1
py27-configargparse-0.14.0
py27-chardet-3.0.4_1
py27-cffi-1.12.3
py27-certifi-2019.6.16
py27-certbot-0.35.1,1
py27-asn1crypto-0.24.0
py27-alabaster-0.7.6
py27-acme-0.35.1,1
py27-MarkupSafe-1.1.1
py27-Jinja2-2.10.1
py27-Babel-2.7.0
portmaster-3.19_18
png-1.6.37
pkgconf-1.6.1,1
phpldapadmin-php72-1.2.3_10,1
php72-xml-7.2.21
php72-session-7.2.21
php72-openssl-7.2.21
php72-ldap-7.2.21
php72-iconv-7.2.21
php72-hash-7.2.21
php72-gettext-7.2.21
php72-7.2.21
perl5-5.28.2
pcre-8.43_1
p5-Unicode-EastAsianWidth-1.40
p5-Text-Unidecode-1.30
p5-Locale-libintl-1.31
p5-Locale-gettext-1.07
openvpn-2.4.7
openssl-1.0.2s,1
openjdk8-8.212.4.1
ninja-1.9.0,2
nasm-2.14.02,1
nano-4.2
mpfr-4.0.2
mkfontscale-1.2.1
minixmlto-0.0.2_1
maven-wrapper-1_2
maven-3.6.1
m4-1.4.18_1,1
lzo2-2.10_1
lua52-5.2.4
libzip-1.5.2
libxslt-1.1.32_1
libxml2-2.9.9
libxcb-1.13.1
libuv-1.30.1
libunwind-20170615
libtool-2.4.6_1
libtextstyle-0.20.1
libpthread-stubs-0.4
liblz4-1.9.1,1
libltdl-2.4.6
libinotify-20180201_1
libiconv-1.14_11
libgpg-error-1.36
libgcrypt-1.8.4_1
libfontenc-1.1.4
libffi-3.2.1_3
libevent-2.1.10
libedit-3.1.20190324,1
libargon2-20171227_1
libarchive-3.3.3,1
libXtst-1.2.3_2
libXt-1.2.0,1
libXrender-0.9.10_2
libXpm-3.5.12_2
libXmu-1.1.3,1
libXi-1.7.10,1
libXfixes-5.0.3_2
libXext-1.3.4,1
libXdmcp-1.1.3
libXau-1.0.9
libX11-1.6.8,1
libSM-1.2.3,1
libICE-1.0.9_3,1
jsoncpp-1.8.1_6
jpeg-turbo-2.0.2
javavmwrapper-2.6
java-zoneinfo-2019.a
jakarta-commons-logging-1.2
jakarta-commons-codec-1.10
jakarta-commons-cli-1.4,1
iso8879-1986_3
indexinfo-0.3.1
icu-64.2,1
httpcore-4.4.11
httpclient-4.5.7
html2text-1.3.2a
help2man-1.47.10
gperf-3.0.3_2
gmp-6.1.2_1
gmake-4.2.1_3
glib-2.56.3_5,1
giflib-5.1.9
gettext-tools-0.20.1
gettext-runtime-0.20.1
gdbm-1.18.1_1
freetype2-2.10.0
fontconfig-2.12.6,1
expat-2.2.6_1
easy-rsa-3.0.6
docbook-xsl-1.79.1_1,1
docbook-xml-5.0_3
docbook-sgml-4.5_1
docbook-1.5
dialog4ports-0.1.6
dejavu-2.37_1
dbus-glib-0.110
dbus-1.12.12
db5-5.3.28_7
curl-7.65.1
cmake-3.14.5
check-0.12.0_1
ca_root_nss-3.45
bison-3.4.1,1
binutils-2.32_1,1
automake-1.16.1_1
autoconf-wrapper-20131203
autoconf-2.69_2
apr-1.6.5.1.6.1_1
alsa-lib-1.1.2_2
Number of packages to be upgraded: 7
Number of packages to be reinstalled: 172
Number of packages to be downgraded: 2
完成后, php --version 工作:
# php --version
PHP 7.2.21 (cli) (built: Aug 8 2019 01:27:53) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
但是,我仍然从 Apache/Wordpress 收到相同的致命错误。