Articles of PHP

不能在CentOS 6.7上安装PHP 5.5

我有一个专用的服务器上Kimsufi 。 我正尝试使用本指南在CentOS 6.7上将PHP 5.3更新到PHP 5.5,但不幸的是我得到以下错误: Error: Package: php-mysql-5.4.45-1.el6.remi.x86_64 (remi) Requires: php-pdo(x86-64) = 5.4.45-1.el6.remi Removing: php-pdo-5.3.3-27.el6.2.x86_64 (@LocalRepo) php-pdo(x86-64) = 5.3.3-27.el6.2 Updated By: php-pdo-5.5.29-1.el6.remi.x86_64 (remi-php55) php-pdo(x86-64) = 5.5.29-1.el6.remi Available: php-pdo-5.4.44-1.el6.remi.x86_64 (remi) php-pdo(x86-64) = 5.4.44-1.el6.remi Available: php-pdo-5.4.45-1.el6.remi.x86_64 (remi) php-pdo(x86-64) = 5.4.45-1.el6.remi Available: php-pdo-5.5.28-1.el6.remi.x86_64 (remi-php55) php-pdo(x86-64) = 5.5.28-1.el6.remi Available: php54w-pdo-5.4.44-1.w6.x86_64 (webtatic) php-pdo(x86-64) = 5.4.44-1.w6 Available: php55w-pdo-5.5.28-1.w6.x86_64 (webtatic) php-pdo(x86-64) […]

在Apache2中使用Ruby代替PHP

所以我知道这是一种可能性,我已经find了适用于旧版本的Apache的教程,但我找不到任何更新的教程。 我所要做的就是使用.rb和.erb文件,就像您已经可以在Apache2中使用.php文件一样。 我更喜欢ruby的小任务,这将是很好,如果我可以写在我的后端脚本。

如何避免PHP Filesman后门

我们有一台服务器,并将其用作我们客户的共享服务器。 大多数客户使用Wordpress,我们为它设置了一个经典的LAMP环境。 我们给予每个客户端的SFTP访问权限(当然还有chroot用户)。 通常情况下,客户是这样隔离的; 但是我们担心,如果他们中的任何一个像Filesman一样上传PHP漏洞,他们可以访问系统并执行任何他们想要的操作(例如列出文件,更改文件)。 为了避免这种情况,我们试图禁用cyberciti.biz上解释的一些PHP函数; 但仍然是Filesman的作品。 我们无法阻止它。 我们可以做些什么来避免这种情况? 有人可以在这里启发我们吗?

pthreads不支持apache2handler SAPI

现在已经有几个星期了,我无法安装pthread。 我将列出错误日志,然后列出我的configuration选项。 这些是我得到的错误: (Apache错误日志) 第0行的Unknown中的pthreads不支持apache2handler SAPI apachectl -V输出 Server version: Apache/2.4.18 (Unix) Server built: Jan 10 2016 14:54:48 Server's Module Magic Number: 20120211:52 Server loaded: APR 1.4.8, APR-UTIL 1.5.2 Compiled using: APR 1.4.8, APR-UTIL 1.5.2 Architecture: 64-bit Server MPM: worker threaded: yes (fixed thread count) forked: yes (variable process count) 同时PHP错误日志: (PHP错误日志) bin / php […]

如何检查如果php内置服务器正在运行

最近版本的PHP有一个内置的web服务器(适用于非生产环境),可以用php -S […] 。 在尝试启动服务器之前,如何检查它是否已经在服务器上运行? 我意识到,哈克的方式是试图启动它,并寻找错误信息Failed to listen on […] ,但我认为可能有一个更清洁的方式:-) 编辑:我忘了提到,最终我希望能够检查这个脚本,只有启动服务器,如果它尚未开始。 我也忘记提到我正在寻找一个Linux解决scheme,但Windows解决scheme当然也是受欢迎的,以防其他人会在这一天寻找:-)

PHP 7与PHP 5(Centos 7)冲突

现在试图安装PHP 7; (在7号) 补充说: rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm Then installed via: yum install php70w php70w-opcache 输出是: [root@host]# yum install php70w php70w-opcache Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: mirrors.advancedhosters.com * epel: mirror.symnds.com * extras: mirror.netdepot.com * updates: mirrors.rit.edu * webtatic: us-east.repo.webtatic.com Resolving Dependencies –> Running transaction check —> Package […]

我无法避免504网关超时

为了避免nginx 504网关超时,我试图在我的PHP代码的开始做到这一点: set_time_limit(0); 此外,我试图提高/etc/php/7.0/fpm/php.ini的时间设置: max_execution_time = 3600 max_input_time = 3600 在/etc/php/7.0/fpm/pool.d/www.conf : request_terminate_timeout=3600 在重新启动nginx之后,我仍然在3600秒之前收到请求时的504网关超时。 我还应该做些什么来避免它呢?

如何在Ubuntu 14上安装PHP 5.6 redis扩展

我们曾经使用PECL来安装PHP的Redis扩展。 但似乎PECL已经放弃了对PHP版本低于7.0的支持。 没有PECL的最好的方法是什么? 我们在运行PHP 5.6的Ubuntu 14.x上 ubuntu@box776:~$ pecl help version PEAR Version: 1.10.1 PHP Version: 5.6.18 Zend Engine Version: 2.6.0 Running on: Linux box776.localdomain 3.13.0-86-generic #131-Ubuntu SMP Thu May 12 23:33:13 UTC 2016 x86_64 更新1 $ sudo apt-get install php5-redis Reading package lists… 0% Reading package lists… 0% Reading package lists… 0% Reading package lists… […]

单个nginx虚拟主机中的不同php-fpm池

我在网上search了一段时间,但不能成功。 我的问题如下: 我想在一个nginx虚拟主机中使用不同的php-fpm池,但是却找不到configuration我的vhostconfiguration的location ~ \.php$ {…}一部分来支持两个不同的工人池。 我唯一的解决scheme是将Web请求redirect到另一个nginx站点。 先谢谢你

用于PHP的AddHandler具有不同的文件扩展名

我正在尝试通过.htaccessconfiguration托pipe的Apache服务器来执行带有PHP扩展名的.asp文件。 但是我不知道AddHandler的正确的handler-name是什么。 原因是我们有一个Flash应用程序是GET请求.asp文件。 我们将在PHP中重写.asp文件,但是我们不能更改Flash应用程序(我们甚至没有源代码)。 我试图使用AddHandler和AddType指令。 AddHandler php-fcgid .php .asp AddType application/x-httpd-php .asp AddHandler application/x-httpd-php7 .asp 指令的例子,我试图无济于事 大多数没有指定input文件。 或者将MIMEtypes设置为application/x-httpd-php .php文件(技术上设置Content-Type HTTP标头)。 现在,我完全理解AddHandler和AddType – 我发现的最好的资源是https://www.webmasterworld.com/apache/4557229.htm#msg4557505 。 主机有,看起来像一个自定义的仪表板pipe理服务器。 我可以将PHP版本从5.4更改为7.0,并在php.ini更改一些设置。 我上传了一个phpinfo(); 和我认为是相关的一些价值是张贴在下面。 Apache版本是未知的,因为它只是报告Server: Apache 。 但是我确定它至less是Apache2,因为Apache 2.0 Handler被列在SAPI模块下。 我怎样才能找出什么正确的handler-name的AddHandler是? PHP版本7.0.9 Server API CGI/FastCGI Configuration File (php.ini) Path /compile/php70/dest/lib Loaded Configuration File /etc/custom_php_config/slavespillet.dk/php.ini Scan this dir for additional .ini files […]