Articles of PHP

在Ubuntu 12.04上configuration和安装PHP 5.3.21时出错

我试图在运行Ubuntu 12.04的Rackspace云服务器上安装PHP 5.3.21,但是在configuration过程中我仍然遇到错误。 它不断给我以下错误: configure: error: Cannot find imap library (libc-client.a). Please check your c-client installation. 这是我的PHPconfiguration脚本: ./configure –enable-fpm –enable-cli –with-fpm-user=phpfpm –with-fpm-group=phpfpm –prefix=/usr/local/php –exec-prefix=/usr/local/php –with-config-file-path=/usr/local/php/etc –with-config-file-scan-dir=/usr/local/php/etc/conf.d –with-libdir=/lib/x86_64-linux-gnu –enable-bcmath –enable-ctype –with-curl –with-curlwrappers –with-pear –enable-dba –with-cdb –enable-exif –enable-ftp –disable-fileinfo –with-gd –with-jpeg-dir –with-png-dir –with-zlib-dir –with-xpm-dir –with-freetype-dir –with-t1lib –enable-gd-native-ttf –with-gettext –with-gmp –with-imap=/usr/local/c-client-2007f –with-imap-ssl –with-ldap –with-ldap-sasl –enable-mbstring=all –with-mcrypt –with-mhash –with-mysql […]

如何禁用特定目录的服务器上的function?

我想在服务器上禁用一些function来提高服务器的安全性。 我遵循这些步骤: 步骤:1打开php.ini文件: vi /etc/php.ini 第2 disable_functions :finddisable_functions并设置新列表,如下所示:disable_functions = exec,passthru,shell_exec,system STEP:3服务httpd重启 借助上述步骤,我可以禁用所有上述function。 现在这些function在服务器上不再可用。 如果我想启用或禁用特定目录的这些function,那么它可能与否?

在CentOS 5.9上的libxml2

我在运行php网站的CentOS 5.9网站服务器遇到问题。 显然libxml2 2.6.26-2.1.21.el5_9.2有一个已知的bug ,但似乎并没有把新版本放入回购库,因为你不能用yum来更新它。 我在这方面search了很多,并且在Serverfault上也发现了一些其他的post,但是它没有起作用。 我在这里尝试乍得的解决scheme,但在最后阶段失败了。 当我尝试执行yum localinstall ,它给了我这个: Transaction Check Error: file /usr/share/man/man1/xmlcatalog.1.gz from install of libxml2-2.7.8-1.x86_64 conflicts with file from package libxml2-2.6.26-2.1.21.el5_9.2.i386 file /usr/share/man/man1/xmllint.1.gz from install of libxml2-2.7.8-1.x86_64 conflicts with file from package libxml2-2.6.26-2.1.21.el5_9.2.i386 file /usr/share/man/man1/xmlcatalog.1.gz from install of libxml2-2.7.8-1.x86_64 conflicts with file from package libxml2-2.6.22-1.i386 file /usr/share/man/man1/xmllint.1.gz from install of libxml2-2.7.8-1.x86_64 […]

为什么PHP忽略session.gc_maxlifetime?

我们有一个基于WAMP的服务器设置。 php.ini设置如下: session.gc_maxlifetime = 60*60*12 session.save_path = "d:/wamp/tmp" 我们面临的问题是tmp文件夹内的会话文件被零星地删除,我们不能说明原因。 会议将持续约10分钟到40分钟,当他们应该持续12小时。 这是一个虚拟主机环境,但是我们在这些站点中使用的代码都不会覆盖这个设置(使用ini_set ,apacheconfigurationPHP值或其他),所以我们看不到为什么他们被删除。 也没有计划任务删除文件。 有没有办法可以成功地找出为什么gc_maxlifetime被忽略? 为了logging,我改变了我们的一个网站使用session_save_path('D:/wamp/tmptmp'); 暂时只是仔细检查它是垃圾收集,会话文件保持在那里没有触动 – 虽然承认这并不能提供更多的线索。

哪些PHP模块需要安装wordpress?

我有5个WordPress站点。 我使用hostgator共享主机为他们所有。 现在我决定打开VPS。 我有一个非托pipe的VPS,并configuration为wordpress。 我正在按照webhostingtalk的成员的build议来学习本教程: https : //www.digitalocean.com/community/articles/how-to-set-up-multiple-wordpress-sites-on-a-single-ubuntu-vps 我正在configurationLAMP堆栈。 步骤是从这个网页: https : //www.digitalocean.com/community/articles/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu 在第3步中,当安装Apache时,它指向我必须selectPHP模块。 我不知道要select什么模块。 我的要求是在WordPress的5-6个网站。 请告诉我为wordpess安装哪些模块? 提前致谢。 编辑:我GOOGLE了,发现这个线程: https : //wordpress.stackexchange.com/questions/42098/what-are-php-extensions-and-libraries-wp-needs-and-or-uses 2票的第四个答案有这个名单: php5-cli php5-dev php5-fpm php5-cgi php5-mysql php5-xmlrpc php5-curl php5-gd php-apc (not required, but recommended) php-pear php5-imap php5-mcrypt php5-pspell 这够好吗?

nginx的+ PHP-FPM(chroot环境)。 没有指定input文件

OS:Centos PHP:5.5.6 Nginx:1.4.4 Nginx conf server { listen 80; server_name example.ltd; root /srv/example.ltd/www; index index.php; access_log /srv/example.ltd/logs/nginx-main.log main; error_log /srv/example.ltd/logs/nginx-error.log warn; autoindex on; location / { try_files $uri $uri/ /index.php; } location ~ \.php$ { fastcgi_pass unix:/srv/example.ltd/tmp/example.ltd.sock; fastcgi_index index.php; fastcgi_param SCRIPT_NAME /www$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param SERVER_NAME $host; fastcgi_param SCRIPT_FILENAME /www$fastcgi_script_name; include fastcgi_params; } } […]

需要关于loggingLAMP网站的build议

我需要logging我的网站。 它是AWS上的Linux / Apache / MySQL / PHP上的音乐网站。 我需要logging一切:架构(5台服务器),数据库(100多台),php类,编程结构和stream程。 我熟悉phpdoc。 否则,我不确定什么是最好的工具。 我想要的工具与行业标准的UML兼容。

连接到本地主机/ 127.0.0.1时连接超时

我有一个Debian Squeeze专用服务器,它包含4个前端网站,以及几个后台工具和API(主要网站)。 自2008年以来,这一切都没有问题 – 但突然间,今天我们遇到了很多110: connection timed out错误,当试图连接到框托pipe的API。 这些应用程序是基于PHP / MySQL的,服务器软件是Apache。 每个调用API调用的域都被映射到/etc/hosts文件中的127.0.0.1,并且在curl和wget的命令行testing中显示实际的DNS查找正常parsing。 连接工作可能是三分之一。 我们检查并增加了(作为预防措施)Apache max_connections 。 同样,mysql的连接限制已经增加 – 但是这两个限制都没有达到。 超时testing请求甚至不涉及Apache错误/访问日志 – 看起来像Apache只是没有响应某些请求。 服务器负载本身永远不会超过0.6。 iptable规则自昨天以来没有改变(当这工作),并允许127.0.0.1内部连接。 绕过一个PHP /重写规则等我已经尝试请求从命令行上的子文件夹的简单图像。 在testing中,这个返回大概是三分之一。 其他时间失败。 任何人都可以build议接下来看什么? ——————更新—————– 似乎服务器间歇性closures端口80。 IP表没有规则来做到这一点… 有任何想法吗?

HAProxy mysql写故障转移

我有一个HAProxy服务器负载平衡两个主服务器在master-master /主动 – 被动模式。 我可以看到,我已经成功地将所有的READS扩展到了我的两个数据库节点,但是如果当前的写入主控closures,我怎样才能轻松地将主控切换为写操作? 现在,我在每个App服务器上都有一个configuration文件,用于写入的DB_HOST_W和用于读取的DB_HOST_R。 DB_HOST_R指向HAProxy服务器。 DB_HOST_W指向其中一个主节点。 HAProxy自动处理READ操作的故障转移,但是如果发生故障,必须更新configuration文件并更改4个以上App Server的DB_HOST_W值将非常耗时。 有没有更好的办法? 我在这里错过了什么? 我想指出,我有以下configuration: server primary 10.152.142.184:3306 check server secondary 10.152.142.185:3306 check backup 但我不喜欢它,因为虽然它将所有WRITE操作发送到主要,但它也会将ALL READ操作发送到主要,并删除可伸缩性。

无法在Debian 6.0服务器上安装php5.5 apcu模块

由于PHP 5.5不支持APC作为OP代码caching,所以我仍然可以使用APC来获取对我来说很好的用户数据。 它被称为APCu,它应该与旧的APC兼容。 不幸的是,我无法以任何方式安装它。 运行: apt-get install php5-apcu 将结束机智错误消息: The following packages have unmet dependencies: php5-apcu : Depends: phpapi-20100525 Depends: php5-common (= 5.4.26-1~dotdeb.0) but 5.5.10+dfsg-1 is to be installed E: Broken packages 我想也许我可以通过PECL来安装它,但是在编译时会抛出错误: /tmp/pear/temp/apcu/apc_cache.c:359: error: '}' expected (got ",") make: *** [apc_cache.lo] Error 1 ERROR: `make' failed 有没有人设法安装APCu?