Articles of PHP5

我无法安装APC

我有PHP 5.3.6和Ubuntu的。 我想安装APC。 当我做$ pecl install apc ,我最终得到一个错误: In file included from /tmp/pear/temp/APC/apc.c:44:0: /usr/include/php5/ext/pcre/php_pcre.h:29:18: fatal error: pcre.h: No such file or directory compilation terminated. make: *** [apc.lo] Error 1 ERROR: `make' failed 当我尝试做$ yum install php-pecl-apc我总是得到错误: No package "php-pecl-apc" available 我尝试了$ yum clean all ,但没有什么区别。 我不知道如何继续。 你有什么build议?

如何彻底清除Ubuntu上的Apache,MySQL,PHP和phpMyAdmin?

我真的需要彻底清除Ubuntu 12.04上的Web服务器。 我试过sudo apt-get purge apache2 php5 libapache2-mod-php5 mysql-server libapache2-mod-auth-mysql php5-mysql phpmyadmin (希望将其全部删除)。 我如何彻底清除所有这些?

在centOS 5.5上启用PHP DOM扩展,无需重新编译

我试图安装Google数据PHP库,安装检查程序告诉我没有安装DOM。 一些谷歌search后,似乎我需要安装php-xml,但已经安装。 然后我决定重新安装php-xml,但卸载后,它似乎已经完全从标准回购中消失。 我的PHP显然是configuration如下 './configure' '–build=i686-redhat-linux-gnu' '–host=i686-redhat-linux-gnu' '–target=i386-redhat-linux-gnu' '–program-prefix=' '–prefix=/usr' '–exec-prefix=/usr' '–bindir=/usr/bin' '–sbindir=/usr/sbin' '–sysconfdir=/etc' '–datadir=/usr/share' '–includedir=/usr/include' '–libdir=/usr/lib' '–libexecdir=/usr/libexec' '–localstatedir=/var' '–sharedstatedir=/usr/com' '–mandir=/usr/share/man' '–infodir=/usr/share/info' '–cache-file=../config.cache' '–with-libdir=lib' '–with-config-file-path=/etc' '–with-config-file-scan-dir=/etc/php.d' '–disable-debug' '–with-pic' '–disable-rpath' '–without-pear' '–with-bz2' '–with-curl' '–with-exec-dir=/usr/bin' '–with-freetype-dir=/usr' '–with-png-dir=/usr' '–enable-gd-native-ttf' '–without-gdbm' '–with-gettext' '–with-gmp' '–with-iconv' '–with-jpeg-dir=/usr' '–with-openssl' '–with-png' '–with-pspell' '–with-expat-dir=/usr' '–with-pcre-regex=/usr' '–with-zlib' '–with-layout=GNU' '–enable-exif' '–enable-ftp' '–enable-magic-quotes' '–enable-sockets' '–enable-sysvsem' '–enable-sysvshm' '–enable-sysvmsg' […]

对于空目录,nginx 404而不是403

我有我的nginx服务器的以下configuration: server { listen 80 default_server; server_name example.com www.example.com; root /var/www/example.com/web; index index.php index.html; location / { # try to serve file directly, fallback to rewrite try_files $uri $uri/ @rewriteapp; } location @rewriteapp { # rewrite all to index.php rewrite ^(.*)$ /index.php last; } location ~ \.php$ { fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_split_path_info ^(.+\.php)(/.*)$; include fastcgi_params; fastcgi_param […]

php5 fpm:你如何从segfault生成核心转储?

在负载下,我的PHP5-fpm(在32位ubuntu 10.10上)产生如下的段错误: kernel: [4881937.884863] php5-fpm[2638]: segfault at 4204eb41 ip 0832d235 sp bfcea5e0 error 4 in php5-fpm[8048000+70d000] 我如何做到这一点,所以这些segfaults产生一个核心转储,以便我可以检查调用堆栈找出段错误来自哪里? 核心堆放在哪里生产?

获取apache2加载新的PHP5

这台服务器运行Ubuntu 9.04,apache 2,并从版本库运行PHP 5.2.6-3ubuntu4.4。 我安装了另一个新版本的PHP(5.3.1,从源代码编译),然后我用/ usr / bin / php5replace了这个版本的链接。 现在cli加载新版本 name:/$php -v PHP 5.3.1 (cli) (built: Dec 9 2009 21:44:18 ) Copyright (c) 1997-2009 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2009 Zend Technologies 但是,Apache仍然加载旧版本。 我应该怎么做才能让Apache加载新版本?

“无法初始化模块”fileinfo php-pecl-Fileinfo.x86_64

我有一个全新的服务器服务器,我正试图build立起来。 这是一个64位的机器,我不能安装“fileinfo”或“memcache”。 我卸载了这些,并重新安装使用百胜和pecl没有运气。 百胜安装罚款“没有错误”,但后来运行PHP时出现错误。 pecl从我能告诉只是安装32位。 不要把任何东西放在lib64目录中。 这是我的输出php -v : PHP Warning: PHP Startup: fileinfo: Unable to initialize module Module compiled with module API=20050922, debug=0, thread-safety=0 PHP compiled with module API=20060613, debug=0, thread-safety=0 These options need to match in Unknown on line 0 PHP Warning: PHP Startup: memcache: Unable to initialize module Module compiled with module […]

升级PHP 5.3.6到5.3.8(Windows)

有没有一种简单的方法可以从Windows(例如5.3.6到5.3.8)从一个PHP维护级别升级到另一个? 还是唯一的选项来重命名我当前的安装文件夹,并安装一个新的副本? 我以前使用一个平面ZIP文件(没有安装程序)安装PHP,而且由于我正在从一个小版本到另一个,我想知道如果我可以做一个简单的文件覆盖(当然,预先停止IIS)。 这两个发行版本之间没有.ini文件差异,我宁愿不必跳过所有PEAR箍来恢复已安装的模块。 PHP文档讨论了从以前的版本升级到现在的版本,但在同一版本中没有关于从一个维护级别到另一个维护级别的信息。 任何提示将不胜感激。

PHP + ImageMagick性能问题

美好的一天, 我有两个环境:OpenVZ VPS和Pentium 4本地开发机器。 他们有相同的方式安装所有的软件包。 ImageMagick是从没有OpenMP支持的来源编译的。 当我运行time convert 'image.jpg' -resize "x60" -crop "60×60" +repage 'thumb'在两台机器上的结果是相似的: real 0m0.059s user 0m0.047s sys 0m0.012s 但是,我通过VPS上的imagick PECL扩展使用ImageMagick与PHP的问题。 在本地环境响应时间大约是50ms,在VPS上它太高了:大约3秒。 在日志中没有错误。 任何想法在这里可能是错误的? 干杯,斯托伊科

我怎样才能阻止IIS 7.5添加自己的redirectHTML到PHP发布的?

我有一个通过FastCgi运行的configuration了PHP 5.4.5的IIS 7.5服务器。 PHP被configuration为在客户端支持的情况下返回gzip编码的数据。 我的问题是当我从PHP发出303 See Other标题时,IIS在gzip编码数据之前粘贴了一些HTML。 对于大多数浏览器来说,这不是一个问题,他们只是按照标题,但是我的客户报告,redirect不通过他们的思科Scansafe代理,我认为这可能是原因。 以下是使用Wireshark捕获的数据包数据: GET / HTTP/1.1 Host: [OMITTED] Connection: keep-alive Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.124 Safari/537.36 Accept-Encoding: gzip,deflate Accept-Language: en-GB,en-US;q=0.8,en;q=0.6 Cookie: PHPSESSID=[OMITTED] HTTP/1.1 303 See Other Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Pragma: no-cache Content-Type: text/html; charset=UTF-8 Content-Encoding: gzip Expires: Thu, […]