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
相关文档:
1.下载安装mcrypt
先去http://www.sourceforge.net下载Libmcrypt,mhash,mcrypt安装包
2 .先安装Libmcrypt
#tar -zxvf libmcrypt-2.5.8.tar.gz
#cd libmcrypt-2.5.8
#./configure
#make
#make install
说明:libmcript默认安装在/usr/local
3.安装mhash
#tar -zxvf mhash-0.9.9.9.tar.gz
#cd mhash-0.9.9.9
#./ ......
上一篇中,简单写了个Input.php , 但生日那一栏要自己手动输入写,比较麻烦,所以这里用到一个JS文件,可以选择日期
点击下载这个js文件
在Input.php文件最顶端引用这个JS文件
<script type="text/javascript" src="calenderJS.js"></script>
将生日的输入框改成
<input name="birthday" type="text" ......
PHP的realpath(...)
Author:zfive5(zidong)
Email :zfive5@yahoo.com.cn
引子:
昨天帮人改了一下PHP程序,在配eclipse+php(xdebug)+mysql+apache后,就陷入一步步漫长而乏味的调试中,虽然工具有些不太好用(但也对php环境9年来的进步感到兴奋), 在整个调试过程中,发现自己完全让rea ......
上一篇我们讲到链接到 Edit.php?id= 来修改数据,后来我想了一下,其实也可以直接利用 Input.php 来修改数据,这样更容易管理,节省了不必要的空间
Input.php可以这样链接:Input.php?id=[Num]&action=[Num]
id即记录ID,默认为-1
action为动作,默认为0 , 为0时代表添加新的记录,为1时则修改记录
In ......
$pagesize=10; //设置每一页显示的记录数
$c("localhost","root",""); //连接数据库
$rs=mysql_query("select count(*) from tb_product",$conn); //取得记录总数$rs
$myrow = mysql_fetch_array($rs);
$numrows=$myrow[0];
Ɍ ......