我的情况是: Apache3.1.24+PHP4.2.0+XP+MySQLApache配置部分内容是:ScriptAlias /php4/ "D:/php4/" AddType application/x-httpd-php4 .php AddType application/x-httpd-php4 .php3 AddType application/x-httpd-php4 .php4 Action application/x-httpd-php4 "d:/php4/php.exe"(PHP所在目录是:d:/php4/,系统在DSH上,呵呵)Apache运行正常,访问PHP脚本时候(比如在地址栏输入:http://localhost/info.php,其中info.php的没 有错误的),出现的错误是:Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Apache记录的错误是:[Tue Apr 04 09:34:07 2000] [error] [client 127.0.0.1] Prem ature end of script headers: d:/php4/php.exe 这回应该不是Apache的错误了吧?我感觉应该是PHP配置了问题了。 你说到底是怎么回事呢? 请指教,谢谢!!!
to : wsrboy(wsrboy) 晕~~ 按照你的说法,我的apache 起不来了~~~~ The Apache service named reported the following error: >>> (22503)系统找不到指定的路径。 : Apache.exe: could not open error log file C:/Program Files/Apache Group/Apache2/htdocs/logs/error.log.
to : wsrboy(wsrboy) 晕~~ 按照你的说法,我的apache 起不来了~~~~ The Apache service named reported the following error: >>> (22503)系统找不到指定的路径。 : Apache.exe: could not open error log file C:/Program Files/Apache Group/Apache2/htdocs/logs/error.log.我告诉你的绝对不会出现这种错误, 这只要你修改一下错误日志的路径就可以了!!呵呵
好了,解决了,不过出现如下错误: Server error! Error message: Premature end of script headers: C:/php/php.exe If you think this is a server error, please contact the webmaster Error 500 localhost 04/27/02 15:49:36 Apache/2.0.35 (Win32)
Action application/x-httpd-php "/php"
AddType application/x-httpd-php .php .php3
AddType application/x-httpd-php4 .php3
AddType application/x-httpd-php4 .php4
AddType application/x-httpd-php4 .php
//你最后一行错误
Action application/x-httpd-php4 "/php4/php.exe"关于 free_free(free_free)的:
//第一行是个安全问题:‘/php’ ,在绿盟上有介绍,切忌!!
ScriptAlias /php "c:/php/php.exe"
Action application/x-httpd-php "/php"
AddType application/x-httpd-php .php .php3
可以告诉我吗?
还有你是配置成cgi还是siap?
Apache3.1.24+PHP4.2.0+XP+MySQLApache配置部分内容是:ScriptAlias /php4/ "D:/php4/" AddType application/x-httpd-php4 .php
AddType application/x-httpd-php4 .php3
AddType application/x-httpd-php4 .php4 Action application/x-httpd-php4 "d:/php4/php.exe"(PHP所在目录是:d:/php4/,系统在DSH上,呵呵)Apache运行正常,访问PHP脚本时候(比如在地址栏输入:http://localhost/info.php,其中info.php的没
有错误的),出现的错误是:Internal Server Error
The server encountered an internal error or misconfiguration and was unable to
complete your request.
Apache记录的错误是:[Tue Apr 04 09:34:07 2000] [error] [client 127.0.0.1] Prem
ature end of script headers: d:/php4/php.exe 这回应该不是Apache的错误了吧?我感觉应该是PHP配置了问题了。 你说到底是怎么回事呢? 请指教,谢谢!!!
你的问题我已经在你的帖子里答复,
你快去看看吧
晕~~
按照你的说法,我的apache 起不来了~~~~
The Apache service named reported the following error:
>>> (22503)系统找不到指定的路径。 : Apache.exe: could not open error log file C:/Program Files/Apache Group/Apache2/htdocs/logs/error.log.
晕~~
按照你的说法,我的apache 起不来了~~~~
The Apache service named reported the following error:
>>> (22503)系统找不到指定的路径。 : Apache.exe: could not open error log file C:/Program Files/Apache Group/Apache2/htdocs/logs/error.log.我告诉你的绝对不会出现这种错误,
这只要你修改一下错误日志的路径就可以了!!呵呵
//-------------------函数:LIST_PAGES()--------------------------------------------------//
//
//
// 功能:通用的分页函数
// 形参:
// $type: 分类,
// $setpage: 显示的页数,
// $setid: 显示的ID,
// $table: 处理的表名,
// $htmlname: 调用分页显示的网页名
// $index: 索引
// $classid: 分类ID;
// GLOBAL:
// $dbhost,$dbuser,$dbpasswd,$dbname; 数据库连接变量
// $list_num: 每页显示的数量
// $list_page_num:每页显示的分页
// 返回:
// 无
// 调用方法:
// list_pages($type,$setpage,$setid,$table,$htmlname,$classid,$index);
//
//------------------------------------------------------------------------------------------------------------//
function list_pages($type,$setpage,$setid,$table,$htmlname,$classid,$index)
{
global $dbhost,$dbuser,$dbpasswd,$dbname;
global $list_num,$list_page_num; if (empty($type) || $type==0)
{
$type = 0;
$istype = "";
}
else{
$istype = "WHERE $classid=".$type;
}
$sql = "SELECT COUNT(*) AS rcnt FROM $table $istype ORDER BY $index DESC";
mysql_select_db($dbname);
$result = mysql_query($sql);
$row = mysql_fetch_array($result); $num = $row['rcnt'];
if (empty($setid))
{
$setid = 0;
} $sql = "SELECT * FROM $table $istype ORDER BY $index DESC LIMIT $setid, $list_num";
mysql_select_db($dbname);
$result = mysql_query($sql);
// 计算页数
$pages = ceil($num/$list_num);
$page = ceil($pages/$list_page_num); if ($setid > 0)
{
$setpage1 = ceil($setid/$list_num);
$setpage = ceil(($setpage1+1)/$list_page_num);
}
else{
$setpage = 1;
} if ($pages > $list_page_num)
{
$pagenum = $list_page_num;
}
else{
$pagenum = $pages;
} $issetid = ceil(($setid+1)/$list_num);
$issetpage = $issetid % $list_page_num;
// 第一页
if ($setpage > 1)
{
echo "<a title='第一页' href='$htmlname?type=".$type."&setpage=1&setid=0'>[1]</a>...\n";
} // 上一列
if ($setpage>1)
{
$lastpage = $setpage-1;
$lastsetid = ($setpage-2)*$list_page_num*$list_num;
echo "<a title='上一列' href='$htmlname?type=".$type."&setpage=".$lastpage."&setid=".$lastsetid."'>[<<]</a> - \n";
} // 上一页
if ($setid > 0)
{ if ($issetpage == 1)
{
$newsetpage = $setpage-1;
}
else{
$newsetpage = $setpage;
} $presetid = $setid-$list_num;
echo "<a title='上一页' href='$htmlname?type=".$type."&setpage=".$newsetpage."&setid=".$presetid."'>[<]</a> \n";
} // 列出页
$i1 = ($setpage-1)*$list_page_num;
for ($i=$i1; $i<($i1+$pagenum) && $i<$pages; $i++)
{
$newsetid=$list_num*$i;
if (($setid/$list_num) == $i)
{
echo "<b><font color=red>[".($i+1)."]</font></b> \n";
}
else{
echo "<a href='$htmlname?type=".$type."&setpage=".$setpage."&setid=".$newsetid."'>[".($i+1)."]</a> \n";
} } // 下一页
if ($pages!=0 && ($setid/$list_num+1)!=$pages && ($setid/$list_num+1)<=$pages||$setid==1)
{
if ($list_page_num-$issetpage == 0 || $issetpage == 0)
{
$newsetpage = $setpage+1;
}
else{
$newsetpage = $setpage;
} $newsetid = $setid+$list_num;
echo "<a title='下一页' href='$htmlname?type=".$type."&setpage=".$newsetpage."&setid=".$newsetid."'>[>]</a> \n";
} // 下一列
if ($pages!=0 && $pages>$list_page_num && $setpage<$page)
{
$nextpage = $setpage+1;
$nextsetid = $setpage*$list_page_num*$list_num;
echo "- <a title='下一列' href='$htmlname?type=".$type."&setpage=".$nextpage."&setid=".$nextsetid."'>[>>]</a>\n";
} // 最后一页
if ($pages>$list_page_num && $setpage<$page)
{
$lastpage = $list_num*($pages-1);
echo "...<a title='最后一页' href='$htmlname?type=".$type."&setpage=".$page."&setid=".$lastpage."'>[".$pages."]</a>\n";
}}
//------------------------------------------ end list_pages------------------------------------------------//
但是,还是以前的问题没有解决
Server error!
Error message:
Premature end of script headers: C:/php/php.exe
If you think this is a server error, please contact the webmaster
Error 500
localhost
04/27/02 15:49:36
Apache/2.0.35 (Win32)
-------------
在Windows98/2K下安装全最新版Apache + PHP4 + MYSQL + phpMyadmin的方法 Version 2.2作者:Lee首先通报一下以上软件现在最新的版本号:
Apache 1.3.24
PHP 4.2.0
MYSQL 3.23.41a
phpMyadmin 2.2.4*************
*一.基本安装*
*************
还用说吗?大家已经人手一份程序,把他们全装上就行了~!呵呵~~建议把他们都装在一个目录下,方便使用嘛。
注意:如果有最新版的程序,建议安装最新版的,这样子很有可能解决以前出现的问题!切记!:)这里假设Windows98/2K装在目录windir下。其它程序建议安装如下:
x:\SERVER
|
|-PROGRAM
|
|-PHP PHP程序目录
|
|-MYSQL MYSQL程序目录
|
|-MYADMIN phpMyadmin程序目录
|
|-APACHE 服务器程序目录*********
*二.设置*
*********
关键就是这里了!大家一步一步慢慢来~!*****
*(1)*将PHP目录下的PHP4TS.DLL复制到windir\system(Win2K是system32),还有将PHP.INI-DIST复制到windir,改名为PHP.INI
*****有一些无关紧要的设置,按自己的需要改吧~:
upload_max_filesize = 2097152; 上载文件的最大字节
include_path = \path1;\path2;\path3…… 在使用include函数时,只有指定目录下的文件才可以被包含******************************************************************************************
关于Session : 有些人说PHP在运行Session的会显示错误,这个问题多半是因为没有为Session建立一个叫
tmp的目录。方法:在x:\下面建立一个tmp的目录。
***********************************************************************************************
*(2)*修改Apache的配置文件
*****在安装的时候,Apache会提示你输入服务器名等,其实都不重要的。因为这些可以后来再改的,哈哈。最重要的,是修改CONF目录下的HTTPD.CONF文件:
Servername xxxxxx 改为 Servername localhost******************************************************************************************
注意:
(1)有人反映,如上设置后,别人的机器无法访问到自己的服务器,访问时会转向localhost。
这个是Apache的问题,有如下规律:如果访问的URL是 http://你的IP/目录
Apache收到请求后 会把URL解析到你所设的ServerName 也就是localhost
那客户方就会访问失败了。要改成 http://你的IP/目录/
才能正常访问.另外.这个问题在直接访问文件的时候不存在.(2)在DocumentRoot的下面不远,会有这样几行:
#
# This should be changed to whatever you set DocumentRoot to.
#
<Directory "E:/server/program/Apache/htdocs">下面有一行:
Options FollowSymLinks MultiViews Indexes请把Indexes删除,改成
Options FollowSymLinks MultiViews这样,htdocs就不会被列出目录列表,要不是太没有安全感啦!大家一定要改!!
******************************************************************************************让Apache支持PHP其实也是很容易的呀,加上下面这么几句,就可以了!
ScriptAlias /php4/ "x:/PROGRAM/SERVER/PHP/"
AddType application/x-httpd-php4 .php
AddType application/x-httpd-php4 .php3
AddType application/x-httpd-php4 .php4
AddType application/x-httpd-php-source .phps
Action application/x-httpd-php4 "/php4/php.exe"这是以CGI方式运行PHP程序!
运行Apache后,显示
Apache/1.3.24 (Win32) running...如果想要以模块方式运行,请按这样子:
AddType application/x-httpd-php .php
AddType application/x-httpd-php .php3
AddType application/x-httpd-php .php4
AddType application/x-httpd-php-source .phps
LoadModule php4_module "x:/server/program/php/sapi/php4apache.dll"运行Apache后,显示
Apache/1.3.24 (Win32) PHP/4.1.2 running...强烈推荐使用模块方式!!!Apache的默认启动文档为index.html、index.html还有DirectoryIndex,我们改成这样,支持更多的文档:
DirectoryIndex index.htm
DirectoryIndex index.html
DirectoryIndex index.php
DirectoryIndex index.php3
DirectoryIndex index.php4好,已经完成了……一半(*#$*^&(#*&%#*&@……)!不过还是先写用phpinfo()写一个测试文件看看吧!:)******************************************************************************************
Win2K的Apache是以服务方式运行,方法是在控制台中运行Apache -i安装服务,运行Apache -u卸载服务。
***********************************************************************************************
*(3)*设置MYSQL
*****在目录下有一个文件MY-EXAMPLE.CNF拷贝到C:\下面,改名为MY.CNF
可以加入用户名,密码,登陆主机,数据库和端口等信息!到BIN目录下,运行MYSQLD-MAX(感觉这个是最好的)!正常情况下DOS窗口一闪而过, 然后按Ctrl+Alt+Del看看有没有,有就是行啦~:)******************************************************************************************
Win2K的MYSQL也是以服务方式运行,方法是在控制台中运行mysqld-max-nt --install安装服务,运行
mysqld-max-nt --remove卸载服务。然后要在winmysqladmin中设置my.ini文件,这是Win2K与Win98差别
最大的地方!!切记!!
******************************************************************************************
*****
*(4)*设置phpMyadmin
*****最新版的phpMyadmin比以前的几版又强大了很多!推荐大家使用!
需要修改一下目录下的config.inc.php文件,把127行的:
$cfgDefaultLang = 'en';
改为
$cfgDefaultLang = 'zh';这样就成中文版的了!虽然意思有点别扭……呵呵~!还有这里:
$cfgServers[1]['host'] = 'localhost';
$cfgServers[1]['port'] = '3306';
$cfgServers[1]['adv_auth'] = false;
$cfgServers[1]['stduser'] = 'root';
$cfgServers[1]['stdpass'] = '';
$cfgServers[1]['user'] = 'root';
$cfgServers[1]['password'] = '';
$cfgServers[1]['only_db'] = '';
$cfgServers[1]['verbose'] = '';这里是有关登录MYSQL服务器的设置,按上面改,缺啥补啥,这样就是使用MYSQL的缺省配置啦~呵呵:)到此,全部安装完成!去爽吧~:)
和php4apache.dll
当然一个是前者的问题另一个是后者的问题
apache2是用动态苦解析的,急他是这些动态库直接放在内存中去解析的
而不是像cgi那中方式
还有注意要在你的httpd.conf文件里加上这样一句话
LoadModule php4_module c:\php\php4apache.dll
而后者就是那个missboy的问题是在system32中加入php4apache.dll动态库,同时根换你的php.exe文件
你的问题完全是版本的问题,建议你多到php.net上去下载相关的资料和动态库文件
很感激,我的问题解决了
我说话算数,请到另外一个页面领100分,thank you