由于我已经迁移了WordPress网站,在更正了一些依赖性问题后,一切都很好。
但我已经开发了一个插件(在托管服务器上工作得很好),但在我的专用服务器上,当我激活它时,我的网站需要3分钟来加载每个页面(但他们最终会自己加载),下面是日志被垃圾邮件的内容:
[30-Jan-2017 06:49:09 UTC] PHP Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/mywebsite/public_html/wp-includes/wp-db.php on line 1564
[30-Jan-2017 06:49:10 UTC] PHP Warning: mysql_connect(): Connection timed out in /home/mywebsite/public_html/wp-includes/wp-db.php on line 1564
[30-Jan-2017 06:49:11 UTC] PHP Notice: Trying to get property of non-object in /home/mywebsite/public_html/wp-includes/query.php on line 4699
据我所知,我认为一切都来自这一行代码:
$manager_wpdb = new WPDB( $db_user, $db_password, $db_name, $db_host);
所以,由于这个插件在其他3个托管网站上运行良好,我很确定它来自我的环境集。
遵循此链接What are PHP extensions and libraries WP needs and/or uses? 我想我都需要php扩展。以下是编译选项:
\'./configure\' \'--build=x86_64-redhat-linux-gnu\' \'--host=x86_64-redhat-linux-gnu\' \'--program-prefix=\' \'--disable-dependency-tracking\' \'--prefix=/opt/cpanel/ea-php56/root/usr\' \'--exec-prefix=/opt/cpanel/ea-php56/root/usr\' \'--bindir=/opt/cpanel/ea-php56/root/usr/bin\' \'--sbindir=/opt/cpanel/ea-php56/root/usr/sbin\' \'--sysconfdir=/opt/cpanel/ea-php56/root/etc\' \'--datadir=/opt/cpanel/ea-php56/root/usr/share\' \'--includedir=/opt/cpanel/ea-php56/root/usr/include\' \'--libdir=/opt/cpanel/ea-php56/root/usr/lib64\' \'--libexecdir=/opt/cpanel/ea-php56/root/usr/libexec\' \'--localstatedir=/opt/cpanel/ea-php56/root/usr/var\' \'--sharedstatedir=/opt/cpanel/ea-php56/root/usr/com\' \'--mandir=/opt/cpanel/ea-php56/root/usr/share/man\' \'--infodir=/opt/cpanel/ea-php56/root/usr/share/info\' \'--cache-file=../config.cache\' \'--with-libdir=lib64\' \'--with-config-file-path=/opt/cpanel/ea-php56/root/etc\' \'--with-config-file-scan-dir=/opt/cpanel/ea-php56/root/etc/php.d\' \'--disable-debug\' \'--with-pic\' \'--enable-rpath=/opt/cpanel/ea-php56/root/usr/lib64\' \'--without-pear\' \'--with-bz2\' \'--with-freetype-dir=/usr\' \'--with-png-dir=/usr\' \'--with-xpm-dir=/usr\' \'--with-vpx-dir=/usr\' \'--enable-gd-native-ttf\' \'--without-gdbm\' \'--with-gettext\' \'--with-iconv\' \'--with-jpeg-dir=/usr\' \'--with-openssl\' \'--with-pcre-regex=/usr\' \'--with-zlib\' \'--with-layout=GNU\' \'--enable-exif\' \'--enable-ftp\' \'--enable-sockets\' \'--with-kerberos\' \'--enable-shmop\' \'--with-libxml-dir=/usr\' \'--enable-xml\' \'--with-system-tzdata\' \'--with-mhash\' \'--enable-dtrace\' \'--libdir=/opt/cpanel/ea-php56/root/usr/lib64/php\' \'--enable-pcntl\' \'--enable-opcache\' \'--with-imap=shared,/opt/cpanel/ea-php56/root/usr\' \'--with-imap-ssl\' \'--enable-mbstring=shared\' \'--enable-mbregex\' \'--with-t1lib=/usr\' \'--with-gd=shared\' \'--with-gmp=shared\' \'--enable-calendar=shared\' \'--enable-bcmath=shared\' \'--with-bz2=shared\' \'--enable-ctype=shared\' \'--enable-dba=shared\' \'--with-db4=/usr\' \'--with-tcadb=/usr\' \'--enable-exif=shared\' \'--enable-ftp=shared\' \'--with-gettext=shared\' \'--with-iconv=shared\' \'--enable-sockets=shared\' \'--enable-tokenizer=shared\' \'--with-xmlrpc=shared\' \'--with-ldap=shared\' \'--with-ldap-sasl\' \'--enable-mysqlnd=shared\' \'--with-mysql=shared,mysqlnd\' \'--with-mysqli=shared,mysqlnd\' \'--with-mysql-sock=/var/lib/mysql/mysql.sock\' \'--enable-dom=shared\' \'--with-pgsql=shared\' \'--enable-simplexml=shared\' \'--enable-xml=shared\' \'--enable-wddx=shared\' \'--with-snmp=shared,/usr\' \'--enable-soap=shared\' \'--with-xsl=shared,/usr\' \'--enable-xmlreader=shared\' \'--enable-xmlwriter=shared\' \'--with-curl=shared,/usr\' \'--enable-pdo=shared\' \'--with-pdo-odbc=shared,unixODBC,/usr\' \'--with-pdo-mysql=shared,mysqlnd\' \'--with-pdo-pgsql=shared,/usr\' \'--with-pdo-sqlite=shared,/usr\' \'--with-sqlite3=shared,/usr\' \'--enable-json=shared\' \'--enable-zip=shared\' \'--without-readline\' \'--with-libedit\' \'--with-pspell=shared\' \'--enable-phar=shared\' \'--with-mcrypt=shared,/opt/cpanel/libmcrypt\' \'--enable-sysvmsg=shared\' \'--enable-sysvshm=shared\' \'--enable-sysvsem=shared\' \'--enable-shmop=shared\' \'--enable-posix=shared\' \'--with-unixODBC=shared,/usr\' \'--enable-intl=shared\' \'--with-icu-dir=/usr\' \'--with-enchant=shared,/usr\' \'--with-recode=shared,/usr\' \'--enable-fileinfo=shared\' \'build_alias=x86_64-redhat-linux-gnu\' \'host_alias=x86_64-redhat-linux-gnu\' \'CFLAGS=-O2 \'-g\' \'-pipe\' \'-Wall\' \'-Wp,-D_FORTIFY_SOURCE=2\' \'-fexceptions\' \'-fstack-protector-strong\' \'--param=ssp-buffer-size=4\' \'-grecord-gcc-switches\' \'-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1\' \'-m64\' \'-mtune=generic\' \'-fno-strict-aliasing\' \'-Wno-pointer-sign\'\' \'LDFLAGS=-Wl,-z,relro \'-specs=/usr/lib/rpm/redhat/redhat-hardened-ld\'\' \'CXXFLAGS=-O2 \'-g\' \'-pipe\' \'-Wall\' \'-Wp,-D_FORTIFY_SOURCE=2\' \'-fexceptions\' \'-fstack-protector-strong\' \'--param=ssp-buffer-size=4\' \'-grecord-gcc-switches\' \'-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1\' \'-m64\' \'-mtune=generic\'\'
现在想知道我可以跟着哪个面包屑前进。使用CentOS、PHP和MYSQL。
谢谢大家。