Articles of PHP

由于地理上的问题,如何在多台服务器上托pipe一个WordPress站点?

WordPress的网站目前在美国托pipe,这是我们目标受众的40%。 其余的游客来自中东,澳大利亚,俄罗斯,中国,新加坡,英国,瑞士,哈萨克斯坦……遍布地图。 随着所有的caching(不是CDN),它在亚洲/大洋洲仍然不足,而且在欧洲也有速度问题。 我可以简单地设置多个服务器,并创build多个Alogging,指向不同地区的不同服务器,并假设来自澳大利亚的访问者将从澳大利亚服务器提供服务? 有小费吗?

在PHP中检查apache -D参数?

我目前使用标志-D var_name在某些机器上启动apache,以便我可以使用apache条件块<IfDefine !var_name>来应用某些apache指令。 有没有办法在PHP中检查这些Apache参数?

我可以用“yum”PHP覆盖“make install”PHP吗?

我已经尝试通过从另一台计算机下载.gz文件来安装PHP,将其转移到Linux PC上,然后执行tar,./configure,make和make install过程。 但是我不知道在哪里。 问题: 加载任何PHP页面显示PHP代码,而不是正确的网站。 现在,我尝试了很多事情来得到这个工作,甚至提出了一个问题,但到目前为止,没有运气。 奇怪的是,它在命令行上工作,但浏览器无法显示它。 我唯一一次使用PHP工作的时候是我用yum来获取它的。 所以我想再试一次。 但是,我不确定在我的系统上安装了PHP的情况下执行yum install php的后果。 我试过的东西: 我试图纠正“显示PHP代码”的问题是一个长长的清单,但总结一下: 重新安装PHP(使用make,我现在想要摆脱的安装) configurationhttpd.conf – 具有不同的结果。 出于某种原因,修改httpd.conf文件绝对会破坏Apache。 至于我摆脱现有的PHP的问题: 我试图进入我提取的PHP的东西,并inputmake uninstall ,但只返回No rule to make target 'uninstall'. Stop. No rule to make target 'uninstall'. Stop. 系统: Fedora 19 x86_64 Oracle 11g Apache 2.4.6 我希望有人能够帮助,并提前感谢任何人。 这个问题已经持续太久了。

无法安装php5-mcrypt

我试图在php下安装mcrypt,不能。 如果我做php test.php | grep mcrypt php test.php | grep mcrypt (其中test.php包含phpinfo() )没有出现,所以我想要安装它。 如果我做sudo apt-get install php5-mcrypt我得到这个: E: Unable to locate package php5-mcrypt 如果我做sudo apt-cache search mcrypt什么都没有出现。 这是我的/etc/apt/sources.list deb cdrom:[Ubuntu 13.04 _Raring Ringtail_ – Release amd64 (20130424)]/ raring main restricted deb http://archive.ubuntu.com/ubuntu raring main restricted deb-src http://archive.ubuntu.com/ubuntu raring main restricted deb http://security.ubuntu.com/ubuntu raring-security main restricted […]

Memcache_connect和安全性

$memcache_obj = memcache_connect('My server's IP address', 11211); 使用这个PHP代码,任何人都可以连接到我的Memcached服务器,并把东西使用memcached_get()? 这是一个安全问题吗? 我怎样才能阻止对它的访问?

Nginx没有find子目录,也没有在默认目录下运行index.php

我从Apache更改为Nginx,现在我有一些问题。 当我尝试访问任何文件夹,例如http://devserver/monitor/web ,我有一个Symfony项目,我得到404错误 当我尝试访问http://devserver我一直得到这个消息File not found. 这就是我的/etc/nginx/conf.d/default.conf文件的样子: server { listen 80; server_name devserver; location / { root /var/www/html; index index.php; } error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; } # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 location ~ \.php$ { root html; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; […]

rpm文件夹中的“u”代表什么?

我目前已经安装了PHP 5.4。 这些软件包的前缀都是“php54-”(pecl,pear,pdo,fpm,gd,mysql等)。 我想过渡到5.5。 包是可用的…但是,而不是所有被称为“php55-”,他们是“php55u-”。 什么是“你”?

本地php.ini不重写主php.ini

我似乎无法获取网站的根(/ var / www)中的php.ini文件来覆盖/ etc / php5 / apache2中的php.ini值 /var/www/php.ini内容 upload_max_filesize = 64M post_max_size = 64M 但是同一目录下的phpinfo()页面分别显示了它们的默认值2M和8M 。 而wordpress显示最大上传大小是2MB。 操作系统:Ubuntu 14.04 LTS PHP:5.5.9-1ubuntu4 有什么想法吗?

在ubuntu服务器的ntpdate更新之后,我总是收到nginx中的旧php文件

当我使用ntpdate ntp.ubuntu.com来同步我的服务器时钟时,发生nginXcaching的问题。 现在,当我请求pathhttp://www.example.com/project/create我收到了我正在处理的旧的PHP文件。 我尝试在nginx.conf中将sendfile设置为off ,甚至在cloudFlare为我的DNSclosurescaching,但没有成功。 当我看着头部分curl -I http://www.example.com/project/create我有以下的回应: HTTP/1.1 302 Moved Temporarily │ Server: nginx │ Date: Fri, 15 Aug 2014 10:51:38 GMT │ Content-Type: text/html │ Connection: keep-alive │ Set-Cookie: PHPSESSID=cihsfrq6aoat5baun8dem01go5; path=/ │ Expires: Thu, 19 Nov 1981 08:52:00 GMT │ Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 │ Pragma: no-cache │ Location: http://www.example.com/site/login 我找不到任何nginxcaching文件夹要删除。 […]

Nginx将旧的PHPurl视为文件

试图弄清楚这一点非常困难。 我已经把我的网站从另一个平台更改为Joomla,现在Nginx无法处理旧的url。 我的老url是这样的: example.com/home.php example.com/contact-us.php 我的新Joomla SEF的Url是这样的: example.com/home example.com/contact-us 根据Joomla指南,我有以下的Nginxconfiguration: location / { try_files $uri $uri/ /index.php?$args; } # Process PHP location ~ \.php$ { try_files $uri =404; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } 我想让Nginx把这些旧的URL传给Joomla来处理它。 现在发生的事情是,Nginx将这些旧的url作为php文件处理,然后向我展示这个No input file specified. 错误。 然后,我改变了PHP块内的try_files为try_files $uri /index.php?$args; 所以我的Nginxconfiguration如下所示: location / { try_files $uri […]