显示标签为“PHP”的博文。显示所有博文
显示标签为“PHP”的博文。显示所有博文

20100305

[PHP] Failed in setlocale()

===========
setlocale(LC_ALL, "zh_CN");
===========
But failed and return FALSE.

Try to list the locales contained in the locale archive file.
===============
# localedef --list-archive
===============

If "zh_CN" is not in the list, try to add it.
===============
# localedef -f GBK -i zh_CN zh_CN
===============

Ref:
http://bbs.php.cn/php/ref.gettext.html#43165
http://docs.php.net/manual/en/function.setlocale.php
# man localedef

20090404

Windows 2003配置PHP扩展

2007/09/12 07:25

1. 下载PHP载php-5.2.4-Win32.zip
2. 解压缩以后重命名为php,并放到C:\根目录下
3. mv php.ini-recommended php.ini
4. vi php.ini
register_globals = On
doc_root = D:\wwwroot
extension_dir = "C:\php\ext"
extension=php_mysql.dll

5. 添加INI文件路径到注册表
添加注册表项HKEY_LOCAL_MACHINE\SOFTWARE\PHP\IniFilePath(字符串类型)
值为C:\php
6. 添加环境变量(到Path)。(需要重启)
C:\php
7. 打开IIS管理器,网站右键属性,在“主目录”标签页中找到“应用程序配置”,添加PHP可执行文件“C:\php\php5isapi.dll”;添加一个新的WEB扩展,扩展名随便,扩展启动的时候运行“C:\php\php5isapi.dll”;重启IIS。
8. WEB根目录下新建文件phpinfo.php,内容为:
phpinfo();
?>

IIS下PHP的错误

2008/01/19 01:57

提示:No input file specified.
原因:比如,wwwroot路径是的D:,但是虚拟目录用的路径是E:。这样php.ini文件中的doc_root变量就有冲突了。
解决:注释掉doc_root变量。


提示:内存位置访问无效
原因:在PHP5.2.4中加载php_sqlite.dll时忘记加载php_pdo.dll文件,运行phpinfo()函数时提示内存位置访问无效。
解决:去掉";extension=php_pdo.dll"前面的分号,重新启动w3svc

20090307

drupal报错 tempnam() [function.tempnam]: open_basedir restriction in effect. File() is not within the allowed path(s)

  • warning: tempnam() [function.tempnam]: open_basedir restriction in effect. File() is not within the allowed path(s): (/home/ftp/512j.com/b/1/n/b1nggou/:/tmp/) in /home/ftp/512j.com/b/1/n/b1nggou/_drupal/includes/file.inc on line 756.
  • 文件无法创建。

解决:
/sites/default/files/下新建tmp目录,权限777。
目前不知道原因。
To be continued


参考:
http://drupalchina.org/node/4212#comment-13277

关闭safe_mode的方法

如果你使用的是虚拟主机而不是自己的server,如果虚拟主机设置safe_mode为on。
那么也许通过如下的三种设置可能会达到关闭的目的,只是可能哦!!

<?php
ini_set
('safe_mode', OFF);
phpinfo();
?>

或者

<?php
ini_set('safe_mode', '0');
phpinfo();
?>


根目录放置“.htaccess”文件,内容为:
php_flag safe_mode off


参考:
http://twpug.net/modules/newbb/viewtopic.php?post_id=5241

Windows下新建以小数点开头的文件.htaccess

今天配置一个php网站,可是需要新建一个.htaccess,郁闷的是现在用的是windows,右键新建记事本,重命名的时候提示“必须键入文件名”。可恶!
于是上网google了一下,发现还是有比较简单的办法的,就是用记事本另存为(或者保存)的时候选择文件类型为所有,然后名称就取“.htaccess”,这样就可以啦。
看起来应该算一个bug吧。

参考:
http://bbs.phpchina.com/viewthread.php?tid=51277

20081001

好用的PHP开源相册系统


ZENPHOTO
AJAX的效果很多哦!
推荐Linuxer使用。