Articles of PHP

找出PHP来自哪里?

如果我input我得到的which php /Applications/MAMP/bin/php/php5.3.6/bin/php 如果我键入where php我得到 /Applications/MAMP/bin/php/php5.3.6/bin/php /usr/bin/php 这很好,但我试图删除/Applications/MAMP/bin/php/php5.3.6/bin/php所以它使用/usr/bin/php的一个,但我找不到哪里被添加? 我检查了所有的.bash*文件和.profile文件,没有发现任何东西。 有没有办法找出为什么命令php使用X包与Y? 就像在blah文件中说的一样,你有一个符号链接,或者你错过了X源文件?

升级php,mysql和apache

我一直在环顾四周,并没有find一个好的答案我的问题。 我目前有我的Centos 6.3服务器上通过百胜安装的PHP 5.3.3。 我需要升级到PHP 5.3.10或更高版本。 这是我的理解,你需要find适合的PHP安装正确的MySQL和Apache包。 有人可以请我指出一个更新指南的方向吗? 顺便说一句,我不是在寻找“百胜更新httpd php5”这让我旧的5.3.3版本。 谢谢,凯文。

如何解决运行在tomcat和quercus上的mediawiki的php警告

我在Tomcat 7上设置了带有quercus(4.0.25)的mediawiki(1.19.2)。安装过程进行的很顺利,没有错误或警告,数据库连接正常,在安装过程结束时,我复制LocalSettings.php根据需要放入mediawiki基础文件夹中。 从那一刻起,我在每个mediawiki页面上多次获得了以下的php警告: webapps\mediawiki\includes\Message.php:388: Warning: function 'htmlspecialchars' called with 4 arguments, but only expects 3 arguments [htmlspecialchars] Message.php: 365:/** 366: * Returns the message parsed from wikitext to HTML. 367: * @return String: HTML 368: */ 369:public function toString() { 370: $string = $this->getMessageText(); 371: 372: # Replace parameters before text parsing 373: $string = […]

Fedora Core 6迁移

我对这个服务器应该做什么感到茫然。 我需要它来运行php5.3和相应的版本的MySQL。 今天我收到了一个客户端,通过使用Fedora core 6的工作,在一些非常小的安装程序上运行10个非常小的网站。 我原来的想法只是升级到php5.3。 我有yum(安装3.0.8)重新configuration为Fedora的档案。 它允许的最新版本的PHP是5.1.8。 我对服务器设置还比较陌生,对于擦除服务器升级它感到紧张。 由于它是大约6-8岁,我不确定它是否会支持最新版本的Fedora。 服务器规格是: Parallels Plesk Panel version 9.5.4 Operating system Linux 2.6.9-023stab048.4-smp CPU GenuineIntel, Intel(R) Xeon(R)CPU E5335 @ 2.00GHz (10gb disk space and 1gb of memory). 我用我的个人服务器的Fedora,所以我有点熟悉它。 我没有做太多奢侈的事情。 有没有办法,我可以逃脱这个噩梦与安装php5.3还是我需要迁移这些网站到一个新的服务器?

为LAMP服务器安装Apache Lucene

我有Ubuntu运行LAMP(Linux,Apache,MySQL和PHP)服务器。 为了提供更好的searchfunction,我的一个朋友推荐安装“Apache Lucene”。 在阅读它的时候,我才知道“Apache Lucene”需要运行tomcat和java。 请让我知道,如果它是可行的,或有其他更好的替代LAMP堆栈。 我在寻找一些经过validation的解决scheme。

我怎样才能为php-5.3.3设置一个unix套接字

日志说,Nginx给坏的网关 *205 connect() failed (111: Connection refused) while connecting to upstream 果然,9000sockets没有打开。 问题是:我不知道如何打开这个端口。 其他问题解决了这个问题的PHP-FPM,build议使用unix套接字。 然而这在这里似乎并不适用,因为php-5.3.3没有php-fpm.conf。 我使用的是5.3。

Raspbian上的Apache2:Multiviews已启用,但无法正常工作

我最近把webserver从我哥哥(我有sudo)设置的ubuntuserver移到了我自己创build的rasbianserver。 在另一台服务器上,多function视图可以直接使用,但是在raspbian上,它似乎并不起作用,它似乎也可以在那里使用。 我正在尝试做的是当我在地址字段中inputmy.doma.in/mobile时findmy.doma.in/mobile.php。 我正在使用与以前相同的可用站点文件,该文件看起来像这样: <VirtualHost *:80> ServerName my.doma.in ServerAdmin [email protected] DocumentRoot /home/christian/www/do <Directory /> Options FollowSymLinks AllowOverride All </Directory> <Directory /home/christian/www/do> Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all </Directory> ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ <Directory "/usr/lib/cgi-bin"> AllowOverride None Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch Order allow,deny Allow from all </Directory> ErrorLog ${APACHE_LOG_DIR}/error.log # Possible values […]

在代理之后阻止IP的Nginx

我在这里运行一个Nginx 1.2.4networking服务器,并且支持我的主机代理防止ddos攻击。 在这个代理背后的缺点是,我需要从额外的头部获得真正的IP信息。 在PHP中,例如,通过执行$_SERVER[HTTP_X_REAL_IP] ,效果很好。 现在在我的主机代理的背后,我有一个非常有效的方法来阻止某些IP的这样做: include /etc/nginx/block.conf并允许/拒绝那里的IP。 但是现在由于代理,Nginx会看到来自1个IP的所有stream量。 有没有一种方法可以让Nginx像X-REAL-IP头一样通过PHP来读取X-REAL-IP ?

无法启动我的phpMyAdmin

我创build我自己的便携式服务器,但我不能让它运行phpMyAdmin,MySQL,PHP和Apache运行除了phpMyAdmin。 当我检查Apache的错误日志,它说 [Fri Nov 09 08:54:37 2012] [warn] pid file F:/Drive WebServer/Drive WebServer/bin/Debug/Apache2bak/logs/httpd.pid overwritten — Unclean shutdown of previous Apache run? PHP Warning: PHP Startup: Unable to load dynamic library './php_mysql.dll' – The specified module could not be found.\r\n in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './php_mysqli.dll' – […]

如何configuration我的404响应

我将如何能够正确地将访问我的网站的人redirect到我的404页面? 我已经创build了我的404.php文件为: <!DOCTYPE html> <html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Page not found | Twilight of Spirits</title> <link rel="stylesheet" href="http://forum.umbradora.net/template/default/css/404.css"> <link rel="icon" type="image/x-icon" href="/favicon.png"> </head> <body> <div id="error"> <a href="http://forum.umbradora.net/"> <img src="/forum/template/default/images/layout/404.png" alt="404 page not found" id="error404-image"> </a> </div> <div id="mixpanel" style="visibility: hidden; "></div></body></html> 我的.htaccess文件是: ErrorDocument 404 http://forum.umbradora.net/404.php 现在,当我去我的网站,并input一个错误的链接,如mack.php或total.html,我得到这个错误: 内部服务器错误服务器遇到内部错误或configuration错误,无法完成您的请求。 请联系服务器pipe理员[email protected],告诉他们错误发生的时间,以及可能导致错误的任何事情。 有关此错误的更多信息可能在服务器错误日志中可用。 此外,尝试使用ErrorDocument处理请求时遇到404 Not Found错误。 任何想法如何解决这个问题? 我曾尝试从子域切换到我的正常path,仍然得到错误。