易截截图软件、单文件、免安装、纯绿色、仅160KB

PHP安装配置

#./configure --prefix=/usr/local/php5 --with-config-file-path=/usr/local/php5 --with-apxs2=/usr/local/apache2/bin/apxs --with-bz2 --with-curl - --with-curlwrappers --enable-ftp --enable-sockets --disable-ipv6 --with-gd --with-jpeg-dir=/usr/local --with-png-dir=/usr/local --with-freetype-dir=/usr/local --enable-gd-native-ttf --with-iconv-dir=/usr/local --enable-mbstring --enable-calendar --with-gettext --with-libxml-dir=/usr/local --with-zlib --enable-zend-multibyte
--with-pdo-mysql=/usr/local/mysql
--with-mysqli=/usr/local/mysql/bin/mysql_config --with-mysql=/usr/local/mysql #make && make install #编译,进行安装。 #cp php.ini-dist /usr/local/php/lib/php.ini 在apache2中修改配置文件 #vi /usr/local/apache2/conf/httpd.conf 找到“#AddType application/x-gzip .gz .tgz” 并在后面加入 AddType application/x-compress .Z AddType application/x-gzip .gz .tgz AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phps 这两行的目的是让apache识别php。 再找到“DirectoryIndex index.html” 加上 index.php 让它把index.php做为默认页 测试环境: cd /usr/local/httpd/htdocs/ # vi /usr/local/httpd/htdocs/index.php 输入: # /usr/local/apache2/bin/apachectl restart 重启apache服务器 例:浏览器中输入:http://192.168.xxx.xxx/index.php测试一下。如果成功会有相关的php的说明,没成功会提示你保存文件内容。 安装问题: PHP5.2.10 Make install 时出现: Fatal error: Error: cannot open phar "/usr/local/src/php-5.2.10/pear/install-pear-nozlib.phar" in /path/php5.2.10/pear/install-pear-nozlib.phar on line 795
make[1]: *** [install-pear-installer] Error 255
make: *** [install-pear] Error 2 解决方法:更换版本 2009-11-11 PHP组程序放到150出现问题,类似以下。 全站提示SQLSTATE[HY000] [2002] Invalid argument,类似信息如下: Fatal error: Uncaught exception 'Zend_Db_Adapter_Exception' with message 'SQLSTATE[HY000] [2002] Invalid argument' in /home/www/private/ZendFramework-1.9.3PL1/library/Zend/Db/Adapter/Pdo/A


相关文档:

使用PHP程序直接调用文本文件的内容

 
如何用php直接调用文本文件内容:首先通过file函数打开服务器上的一个文本文件,返回的$myFile 就将成为这个文件操作的句柄,然后再通过循环指令,取出文件中每一行的内容并打印出来。
 
编程思路
 
首先要使用的函数为fi1e,本函数与 readfile() 类似,不同的地方为 file 函数将文件中的内容全部读出 ......

php中session出现warning或note提示 解决方法

方法1:error_reporting (E_ALL ^ E_WARNING);
           session_start();
方法2:error_reporting (E_ALL & ~E_NOTICE);
if (!isset($_SESSION)) {
    session_start();
};
方法3:改php.ini 中error_reporting ......

PHP分页方法

$pagesize=10; //设置每一页显示的记录数
$c("localhost","root",""); //连接数据库
$rs=mysql_query("select count(*) from tb_product",$conn); //取得记录总数$rs
$myrow = mysql_fetch_array($rs);
$numrows=$myrow[0];

Ɍ ......

php 截取utf 8字符串

找了很多这样的函数,还是觉的这个最好了
$a = 'aadfdsf夺顶替一枯基22245顶替sdffh压下';
/**
* 截取utf-8字符
* @param string $string
* @param int$length
*
* return string
*/
function cutstr($string, $length) {
preg_match_all("/./u", $string, $info);
$i = 0;
$str = '';
foreach($inf ......

PHP中一种字符串的倒置方法

前段时间去一家公司面试,有一道题目就是:怎么把给定的一个字符串逆序,字符串中包括中文
由于当时没有回答上来,后来回到先学校认真想了下,也在网上找了一些资料,按他们的方法去实现,可结果都有乱码!忒郁闷,又过了会儿想出来了这个方法如下:
------------------------------------------------------------------ ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号