关于CentOS平台php加入pdo_mysql支持
环境:在linux 系统下安装好PHP+mysql +apache环境发现PHP没有支持pdo_mysql扩展于是决定重新编译PHP,其中mysql采用rpm方式安装
尝试:./configure --with-apxs2=/usr/local/apache/bin/apxs --with-iconv --with-oci8=instantclient,/usr /lib/oracle/10.2.0.1/client/lib --with-mysql=/usr/local/mysql --with-gd=shared --with-zlib-dir=/usr --enable-gd-native-ttf --with-freetype-dir=/usr/local/modules/freetype --with-ttf --with-jpeg-dir --with-png-dir --with-gd=/usr/local/modules/gd --with-jpeg-dir=/usr/local/modules/jpeg6 --with-zlib --enable-magic-quotes --enable-ftp --with-iconv --enable-mbstring --with-pdo-mysql=/usr/local/mysql
编译错误报告:Can't find mysql installation.
错误原因:采用rpm方式安装mysql,无法定位准确的mysql安装目录。
解决办法:下了一个免安装版mysql到Linux系统,解压后放入/usr/local/mysql,再次编译php成功。
重启apache,访问speedCms系统,系统报告错误:
Can't connect to local MySQL server through socket '/tmp/mysql.sock' (111)
经过查询,发现使用rpm安装模式的mysql其mysql.sock文件的具体位置在 /var/lib/mysql/mysql.sock
由于php程序默认查找/tmp/mysql.sock ,此文件又不存在,所以报错。
解决办法:执行以下命令建立链接,问题解决。
ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock
相关文档:
1.使用PHP的创始人 Rasmus Lerdorf 写的APC扩展模块来实现(http://pecl.php.net/package/apc)
APC实现方法:
安装APC,参照官方文档安装,可以使用PECL模块安装方法快速简捷,这里不说明
配置php.ini,设置参数 apc.rfc1867=1 ,使APC支持上传进度条功能,在APC源码说明文档里面有说明
代码范例:
复制PHP内容到剪 ......
PHP4:
<?
$sample1 = new StdClass();
$sample1->name = "Hasin";
$sample2 = $sample1;
$sample2->name = "Afif";
echo $sample1->name;
?>
In PHP4 it works differently; it will output Hasin, as both are different from
each other.
PHP5:
<?
$sample1 = new StdClass();
$ ......
来源:蓝色理想 作者:Dreamer 2007年10月16日 14:50 网友评论:0条 点击:
2737
Dreamer的Blog:www.zhuoqun.net/
英文原文:Creating MyTube with Flex and PHP
原文地址:
http://www.onlamp.com/pub/a/php/2007/05/24/creating-mytube-with-flex-and-php.html
原文作者:Jack Herrington
随着宽带的普及、 ......
由于 在php4的环境下. 都没找到自动生成的函数. 所以自己改写了一个别人些的类. 用来自动生成xml 文件.
<?php
/*
*** 功能 : php4自動生成xml 文件類
*** @ edit: zxwo0o
*** @ time: 2009-9-22
*/
class php4xml{
var $version; //版本號
var $start; ......