Apache 2 and PHP 5 (mod_php) on Linux
Apache 2 and PHP Installation
The following notes are how I got Apache 2 and PHP 5 (or PHP 4) working together on Linux. These instructions also apply, mostly, for any UNIX-like system, especially other Linux distributions. If you have a recent Linux distribution (say since 2002), you already have Apache 2 and PHP, so you don't need to do this unless you want the latest Apache 2 or PHP release or need to customize the Apache or PHP software. Don't forget to remove (or at least disable) the Apache rpm package if you install your own custom Apache.
Apache 2 Version Tip: Beginning with Apache 2.0.42 the API will be kept stable (yeah!). That means you will NOT have to recompile modules (and possibly upgrade/fix source) every time you install a new Apache release. This assumes you stay in the same Apache release series. For example, upgrading from 2.2.0 to 2.2.2 should work. This will not apply to upgrading to the next series (e.g., "development" 2.3.x or "stable" 2.4.x).
I was only able to get PHP working with Apache 2 as a *.so DSO ("dynamic shared object"), as opposed to compiled into Apache (with a static *.a library). I think DSO is the only way PHP is supported now on Apache 2.
I first used httpd-2.0.43 and php-4.3.0 with RedHat 7.3. I am now using httpd-2.2.3 and php-5.2.0 with SUSE 10.1.
Note: If you have problems with PHP and think it's a recent bug, you may want to consider using the latest http://snaps.php.net/ snapshot. Beware that snapshots frequently have regression and are not for production use. Usually problems are because of mis-configuration, not bugs, so snapshots will probably hurt more than help.
Download/unpack Apache2 source from the Apache httpd server website, http://httpd.apache.org/
In the Apache 2 source directory, create a Makefile by typing:
./configure --prefix=/usr/local/apache \
--enable-so \
--enable-cgi \
--enable-info \
--enable-rewrite \
--enable-speling \
--ena
相关文档:
例子程序。
<?php
define('CLIENT_MULTI_RESULTS', 131072);
$link = mysql_connect("127.0.0.1", "root", "",1,CLIENT_MULTI_RESULTS) or die("Could not connect: ".mysql_error());
mysql_select_db("vs") or die("Could not select database");
?> ......
小编之前也曾报导过PHP开发人员容易忽略的几点精华,除了一些精华技术方法外,很多细微之处也是程序员
们容易忽略的,下面我们为您总结了10个关于PHP你可能不知道的事情。
关于PHP更多内容,欢迎访问:PHP开发基础入门
1.使用ip2long() 和long2ip()函数来把IP地址转化成整型存储到数据库里。
这种方法把存储 ......
it is 21th of May. The Month of PHP Security
(http://www.php-security.org) is still running and we have reached a
vulnerability count of 40 vulnerabilities, which is nearly as much as we
disclosed during the whole Month of PHP Bugs in 2007. However there are
11 more days until the end of May and ......
【1】页面之间无法传递变量 get,post,session在最新的php版本中自动全局变量是关闭的,所以要从上一页面取得提交过来得变量要使用$_GET['foo'],$_POST['foo'],$_SESSION['foo']来得到。当然也可以修改自动全局变量为开(php.ini改为register_globals = On);考虑到兼容性,还是强迫自己熟悉新的写法比较好。
【2】Wi ......
php教程 调用mssql存储过程实例应用
用mssql_init语句用于初始化存储过程,而后调用mssql_bind语句指定存储过程参数,最后调用mssql_execute执行存储过程。
*/
//连接mssql数据库教程服务器
$link = mssql_connect("127.0.0.1", "sa", "sa") or die("Can't connect sql server");
mssql_sele ......