Posts Tagged ‘php’

PhpList Can Work With SSL POP

Wednesday, December 3rd, 2008

想要phpList process bounce messages,邮箱却只支持SSL POP (port 995, 如gmail)?没问题。

config.php 作以下设置:

$bounce_protocol = 'pop';
$message_envelope = 'username@gmail.com';
$bounce_mailbox_host = 'pop.gmail.com';
$bounce_mailbox_user = 'username@gmail.com';
$bounce_mailbox_password = 'password';
$bounce_mailbox_port = "995/pop3/ssl/novalidate-cert";

我本还担心phpList 不能从gmail上pop出bounce messages,正想着去专门建一个未经SSL处理的POP邮箱,没想到phpList轻易就达到了我的要求。

另外我还发现,按照phpList自己的说法,php必须运行在safe_mode off的环境下才能让phpList 处理bounce messages,但我亲身实验结果显示safe_mode can be on.

httpd.conf Can Override php.ini

Saturday, November 29th, 2008

httpd.conf and php.ini, which has priority? I have done some experiments, and the conclusions are -

  • php settings in php.ini can be overrided by httpd.conf (or some other Apache configuration files) with php_admin_value, php_admin_flag, php_value, and php_flag.
  • However, I find on Linux, if php_admin_value, php_admin_flag, php_value, or php_flag can not be put inside of VirtualHost block. They can be put inside of Directory block, but if Directory is inside of VirtualHost, they won’t work. I assume it is a php bug because on Windows php_admin_value, php_admin_flag, php_value, or php_flag can be inside of VirtualHost or Directory blocks.
  • Some of php directives can only be set by php_admin_value or php_admin_flag, for example, safe_mode. Others can be set by php_admin or php_(non_admin), for example, display_errors. But if display_errors is set by php_admin, it is not overridable by .htaccess; if display_errors is set by php_(non_admin), .htaccess can override it.

safe_mode

Thursday, November 27th, 2008

我想用script.php访问文件系统,但又想把script.php能访问权限限制在script.php owner 的权限内(而不是apache的权限)。今天才知道把safe_mode turn on就可以,真是又高兴又痛苦,因为很久以前我就想限制script.php的访问权限了,不知道怎么,当时我得出的结论是php 以cgi模式安装才能做到权限检查,sapi模式是做不到的。可能fastcgi过分宣传它的安全特性给我造成一种错觉,其实就文件访问权限来说,sapi一样安全。

同样也是很久以前,见论坛上有个好学的人想要一个免费的空间体验一下xoops,对于好学的人我总想热心帮忙的,况且我又不用额外支出,何乐而不为。无奈我的服务器的designer做的初始设置不是针对share hosting的,safe_mode default off。这样把服务器分给别人用我总归不放心,所以最终没有划空间给好学之士。

safe_mode=on,真就这么简单!

在Fedora上安装mcrypt

Saturday, August 9th, 2008

最近我为了让Godaddy的服务器支持magento,就要装mcrypt module,顺便也可以了却phpmyadmin登录时的一段warning message。

Linux 的大虾们别笑话我,这么点小事让我忙乎了半天。对我来说,Windows下很简单的问题,Linux下就不简单。Linux命令我只能依样画瓢,很少能举一反三。Linux有不同版本,我的Godaddy Server装的是Fedora,好不容易找到一份明确适用于Fedora的mcrypt安装步骤。当然知道了步骤,操作起来是相当简单的。

  1. At the terminal, su root - you are now going to yum, not ./configure, make, and make install…
  2. yum install mcrypt - this will get you libmcrypt, mhash, and mcrypt
  3. yum install php-mcrypt - this will get you the functionality within PHP