Tag Archives: Linux

chmod(): Operation not permitted

PHP项目中除了在Web服务器中运行的程序外,可能还会有直接运行的脚本,他们可能共享一些数据或代码,但当如果运行的用户不同(都不是root)时,在调用chmod()时就会出现chmod(): Operation not permitted这样的错误。 事实上这并不是PHP的问题,而是与系统有关, 我的系统是CentOS 5.6。在CentOS中, chmod, chown只能对属于执行该命令的用户的文件进行操作。对于Fedora, Redhat应该是一样的。

Posted in Linux, PHP | Tagged , , | Leave a comment

CentOS5.6上GD库支持freetype的问题

不知是我的系统问题还是CentOS本来就存在这个问题,通过yum install gd gd-devel 安装的GD库不支持freetype, 即使在编译PHP时添加–with-freetype-dir=/usr/lib也没有用。 最后只有将通过yum安装的gd清除(这一步很重要),重新编译gd: ./configure –prefix=/usr/local/gd\ –with-jpeg=/usr/lib\ –with-png=/usr/lib\ –with-xpm=/usr/lib\ –with-freetype=/usr/lib\ –with-fontconfig=/usr/lib\ 重新编译PHP: ./configure –enable-fpm\ –with-openssl\ –with-zlib\ –enable-calendar\ –with-curl\ –with-curlwrappers\ –enable-ftp\ –enable-mbstring\ –with-mysql=mysqlnd\ –with-mysqli=mysqlnd\ –with-pdo-mysql=mysqlnd\ –enable-pcntl\ –enable-sockets\ –enable-zip\ –enable-soap\ –with-fpm-user=www\ –with-fpm-group=www\ –with-mcrypt=/usr/lib64\ –prefix=/usr/local/php\ –with-jpeg-dir=/usr/lib\ –with-png-dir=/usr/lib\ –with-freetype-dir=/usr/lib\ –with-gd=/usr/local/gd2\ –with-gettext … Continue reading

Posted in Linux, PHP | Tagged , , , | Leave a comment

An overview of GNOME3

It made me upset that my laptop cannot install Fefora 15 which includes gnome3 for compatibility problem. Today I finally install it on my older desktop computer. The gnome3 is really exciting for it’s simply beautiful desktop as it’s official … Continue reading

Posted in Linux | Tagged , , , | Leave a comment

在Linux下使用宋体

操作系统:CentOS5.5 1. 将Windows下的字体文件(如simsun.ttc, tahoma.ttf, tahomabd.ttf等) Copy到/usr/share/fonts/chinese/TrueType/simsun 2. 编辑/etc/X11/fs/config, 加入字体路径 # where to look for fonts catalogue = /usr/share/X11/fonts/misc:unscaled, /usr/share/X11/fonts/75dpi:unscaled, /usr/share/X11/fonts/100dpi:unscaled, /usr/share/X11/fonts/Type1, /usr/share/X11/fonts/TTF, /usr/share/fonts/default/Type1, , /usr/share/fonts/chinese/misc:unscaled, /usr/share/fonts/chinese/misc, /usr/share/fonts/chinese/TrueType/simsun, #字体路径 /usr/share/fonts/chinese/TrueType

Posted in Linux | Tagged | Leave a comment

PHP mysqlnd error

My php is compiled with the following configuration on CentOS5.5: ./configure –with-mysql=mysqlnd –with-mysqli=mysqlnd … When I try to connecting to MySQL, the following error occurred. Error Warning: mysql_connect(): [2002] No such file or directory (trying to connect via unix:///tmp/mysql.sock) in … Continue reading

Posted in PHP | Tagged , | Leave a comment