Articles of PHP

PHP升级到5.4后奇怪的字符

看来PHP升级“打破了”在我的主机上使用PHP的所有网站。 它在使用PHP的每个页面的页脚中添加垃圾字符: 我该如何解决这个问题?

连接到远程mysql服务器

我用这个连接到我的本地mysql服务器: <? $host = "localhost"; $user = "root"; $pass = ""; $db1 = "mydb"; $db = mysql_connect($host,$user,$pass); mysql_select_db($db1,$db); ?> 但是,我想连接到远程mysql服务器。 我的意思是该网站将在同一台服务器上,但我会连接到另一台MySQL服务器。 我怎样才能做到这一点? 我在Ubuntu上。

来自php -v的意外输出

只是在我的Centos 5服务器上运行php -v,并得到以下消息。 Failed loading /usr/lib64/php/modules//php_ioncube_loader_lin_5.1_x86_64.so: /usr/lib64/php/modules//php_ioncube_loader_lin_5.1_x86_64.so: undefined symbol: zend_unmangle_property_name_ex PHP 5.2.17 (cli) (built: Jan 7 2011 10:39:29) Copyright (c) 1997-2010 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies PHP似乎运行正常,但我不喜欢这个消息的外观。 这个信息是什么意思,我该怎么办? (我不想升级到5.3,因为有些客户端站点仍然使用PHP 5.3中的弃用function。)

使用monit重启自定义守护进程

我使用系统守护进程pear类写了一个php守护进程。 如何使用monit在失败时重新启动它? 我在我的监视configuration文件中有以下代码: check process merge with pidfile /var/www/merge/merge.pid group 1000 start program = "/etc/init.d/merge start" stop program = "/etc/init.d/merge stop" IF CHANGED PID then restart 我的目标是,如果守护进程失败(由于错误而停止运行),我想让它重新开始运行。

PLESK PostFix错误本地循环在maillog,如何排查故障

我在CentOS6,Plesk 10.4上使用PostFix的PHP mail()函数,而我的电子邮件没有传送到特定的地址。 我的个人GMail和Yahoo电子邮件地址从我的服务器收到电子邮件罚款,不会产生错误。 在这里的一个精彩的build议后,我检查了我的邮件日志,这是我看到的错误: Apr 10 10:26:29 ######### postfix/qmgr[8323]: 19EA21827: from= <[email protected]>, size=645, nrcpt=1 (queue active) Apr 10 10:26:29 ######### postfix-local[8331]: postfix-local: [email protected], [email protected], dirname=/var/qmail/mailnames Apr 10 10:26:29 ######### postfix-local[8331]: cannot chdir to mailname dir name: No such file or directory Apr 10 10:26:29 ######### postfix-local[8331]: Unknown user: [email protected] Apr 10 10:26:29 ######### postfix/pipe[8330]: […]

在Snow Leopard上设置Mod_rewrite问题

可能重复: 一切你想知道Mod_Rewrite规则,但不敢问? 我已经回到了这个年龄段的其他事情旁边。 所以请在下面find我的细节,这些细节我仍然得到以下错误: 500 Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, [email protected] and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error […]

加载php_mysql.dll时,apache崩溃

我试图让php_mysql工作。 我在一个Windows 7的盒子,用PHP 当我有;extension=php_mysql.dll注释掉,像这样,Apache的作品,PHP的作品,当然在后台的MySQL工作,但我不能用PHP与MySQL。 (我的目标是安装一个phpBB3论坛,并没有列出可用的mysql。) 现在我注意到的是,虽然PHP在Apache中工作(也就是说,它适当地提供了PHP页面),它在命令行上失败。 我不知道这是否相关,或者如果我只是从命令行做错了。 继续… 当我取消注释扩展行时,出现以下错误: Faulting application name: httpd.exe, version: 2.2.22.0, time stamp: 0x4f242d7a Faulting module name: php5ts.dll, version: 5.2.17.17, time stamp: 0x4d25fb49 Exception code: 0xc0000005 Fault offset: 0x000f424c Faulting process id: 0x1ba8 Faulting application start time: 0x01cd24b82c102b69 Faulting application path: C:\Program Files\Apache Software Foundation\Apache2.2\bin\httpd.exe Faulting module path: C:\php\php5ts.dll Report Id: […]

php5-suhosin破碎的安装

嗨,我试图安装时,得到以下错误,你有任何想法如何解决? apt-get install php5-suhosin Reading package lists… Done Building dependency tree Reading state information… Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The […]

麻烦configurationnginx和php

我一直无法获得一个PHP脚本与Nginx的工作。 调用脚本my-url:90 / useraccessauthorization / useraccessauthorization.php给我一个404错误。 以下是我的configuration细节。 有人能让我知道我失踪了吗? 提前致谢。 编辑 :我也应该提到,运行“/etc/init.d/nginx reload”给了我结果: 重新加载nginxconfiguration:nginx:[alert]无法打开错误日志文件:open()“/var/log/nginx/error.log”失败(13:权限被拒绝)2012/05/10 16:07:13 [warn ] 18214#0:只有主进程以超级用户权限运行时,“user”指令才有意义,在/etc/nginx/nginx.conf中将忽略:1 nginx:configuration文件/etc/nginx/nginx.conf语法是好的2012/05/10 16:07:13 [emerg] 18214#0:open()“/var/run/nginx.pid”失败(13:权限被拒绝)nginx:configuration文件/ etc / nginx / nginx。 conftesting失败 / etc / nginx / sites-available / default: server { listen 90; root /usr/share/nginx/www; index index.html index.htm; access_log /var/log/nginx/top-secret-project.access.log; server_name localhost; location / { try_files $uri $uri/ /index.html; […]

具有“../”或“./”的path的PHP include / require函数失败

我今天login到我的开发服务器,发现PHP没有包含一些带有这个E_WARNING消息的文件: 警告:include_once(../ file2.php)[function.include-once]:未能打开stream:没有这样的文件或目录在/var/www/web/some_directory_1/file1.php在线任何 我用我们的系统pipe理员进行了一些研究,发现只有在path中包含'../'或'./'文件path时,PHP才会失败。 假设我们的文件结构如下所示: 在/ var / WWW /networking/ – index.php – file2.php – some_directory_1 / —- file1.php —- file3.php 如果file1.php想包含file2.php,这将工作: include_once('/var/www/web/file2.php'); 但是这不会: include_once('../file2.php'); 现在,坚持一秒钟…我知道你在想什么! “哦,他们的include_path只是FUBAR。” 那么,不完全是。 如果你在index.php中这样做,它可以工作: include_once('some_directory_1/file1.php'); 如果你在file1.php中这样做,它也可以工作: include_once('file3.php'); 我们的include_path被设置为.:/usr/lib/php 。 在过去24小时内没有任何关于服务器环境的变化(没有更新,没有新的软件,没有对包含进行更改,没有更改Apache或PHPconfiguration),我和系统pipe理员是唯一访问服务器的人过去24小时,包括昨天工作得很好。 我们用尽了可能的原因。 任何线索可能会导致这种情况发生? 编辑:忘记了PHP的警告消息。