求00 OK Server: apache php mysql/2.0.43 Content

使用Fiddler2录制HTTP操作脚本
- ITeye技术网站
博客分类:
Fiddler本身是用来做web debugging的工具。其具体的介绍和更多的使用方法请参考知识库中以下文章:
Fiddler---Web调试代理工具
在线调试JavaScript和CSS
本文将详细介绍如何通过fiddler2录制http操作请求的脚本。
为了只保留操作过程中的关键请求数据,我们需要自定义fiddler的过滤项。
完整的录制步骤如下:
打开fiddler2,此时后台会启动一个代理服务器。此后所有的http请求都会经过此代理服务器进行请求转发。
配置fiddler2过滤项。
1:首先需要只保留fiddler对浏览器请求的捕捉。点击左下角处的"All processes"变成"Web Browers"即可。这样fiddler就只捕捉IE或Firefox的请求
2:指定默认的Rules。在fiddler的菜单栏中选择"Rules",弹出下拉列表后,选择以下三项:"Hide Image Requests","Remove All Encodings","Hide 304s".
自定义过滤规则。由于目前的平台4.0系统中存在有大量的循环或显示用的请求,因此还需要自定义过滤规则。
3:选择"Rules"---&"Customize Rules",在弹出的文本文件中进行修改和补充后,自定义规则即时生效。或者使用Rules插件进行修改.
在该文件中找到static function OnBeforeRequest(oSession: Session),OnBeforeResponse方法,增加相应的过滤规则,就会相应的过滤请求。
以下为OnBeforeRequest中增加的过滤条件.附件为一修改后的脚本CustomRules.js
该文件位于C:\Documents and Settings\username\My Documents\Fiddler2\Scripts
//过滤请求不显示到界面上.
if(oSession.HTTPMethodIs("GET")){
oSession["ui-hide"] = "true";
if (oSession.uriContains("BootAndPtStatus.do")){
oSession["ui-hide"] = "true";
if (oSession.uriContains("Alarmlog.do")){
oSession["ui-hide"] = "true";
if (oSession.uriContains("SystemRun.do")){
oSession["ui-hide"] = "true";
}保存脚本。在左侧的请求序列中,选择需要保存的请求数据后,点击右键在弹出的界面中,选择"Save "-&"Sessions"-&"As Text".这样选中的请求就会以文本形式保存。
下面为保存的已录制脚本数据.
该脚本中包含三个步骤的操作:登陆-&强制登陆--&登出
POST /login.dof?action=userLogin HTTP/1.1
Accept: */*
Accept-Language: zh-cn
Referer: http://192.168.19.2:8080/login.html
x-requested-with: XMLHttpRequest
Content-Type: application/x-www-form- charset=UTF-8
UA-CPU: x86
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 ( MSIE 7.0; Windows NT 5.1; QQDownload 1.7; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30)
Host: 192.168.19.2:8080
Content-Length: 30
Connection: Keep-Alive
Pragma: no-cache
Cookie: JSESSIONID=C404BAFA08A5EF1BAE2D49
username=admin&password=123456
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Content-Type: text/charset=utf-8
Date: Mon, 16 Mar :47 GMT
Content-Length: 132
{"success":false,"errors":{"exception":""},"isgrab":"[admin]正在被IP=[192.168.12.154]的用户使用中,是否抢占登录?"}
------------------------------------------------------------------
POST /login.force?action=userLogin HTTP/1.1
Accept: */*
Accept-Language: zh-cn
Referer: http://192.168.19.2:8080/login.html
x-requested-with: XMLHttpRequest
Content-Type: application/x-www-form- charset=UTF-8
UA-CPU: x86
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 ( MSIE 7.0; Windows NT 5.1; QQDownload 1.7; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30)
Host: 192.168.19.2:8080
Content-Length: 30
Connection: Keep-Alive
Pragma: no-cache
Cookie: JSESSIONID=C404BAFA08A5EF1BAE2D49
username=admin&password=123456
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Set-Cookie: JSESSIONID=FD32FBA72A1BAD3ACBEB616; Path=/
Content-Type: text/charset=utf-8
Date: Mon, 16 Mar :50 GMT
Content-Length: 44
{"success":true,"message":"操作成功!"}
------------------------------------------------------------------
POST /logout.dof?action=logout HTTP/1.1
Accept: */*
Accept-Language: zh-cn
Referer: http://192.168.19.2:8080/index.html
x-requested-with: XMLHttpRequest
UA-CPU: x86
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 ( MSIE 7.0; Windows NT 5.1; QQDownload 1.7; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30)
Host: 192.168.19.2:8080
Content-Length: 0
Connection: Keep-Alive
Pragma: no-cache
Cookie: JSESSIONID=FD32FBA72A1BAD3ACBEB616
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Content-Type: text/charset=utf-8
Date: Mon, 16 Mar :00 GMT
Content-Length: 59
{"success":false,"errors":{"sessionout":true,"outinfo":""}}
Fiddler 具有强大的分析、编码解码(带有一个编码解码工具)、伪装(可动态伪装为任意主流浏览器)等能力。
支持 GZIP 压缩,支持 IPv6,从 2.* 版本开始支持 HTTPS 协议以并可进行动态解密。
支持图像,XML 以及网页表单数据查看。
带有过滤器,方便过滤无关结果。还有“时间线”可以查看收到数据的先后顺序及总耗时。
还带有“请求生成器”可发送自定义数据到服务器。特有的“自动应答”功能可以直接拦截并处理来自浏览器的特定请求而不发送到服务器。
支持插件(扩展),可自定义规则(语法为 JavaScript),甚至设置断点。
不过,目前动态捕获功能似乎只适用于基于 IE 内核的浏览器。
最后,此软件完全免费。我已经用了好几个月,稳定性还是不错的。
下载:
2.* 稳定版本:/dl/Fiddler2Setup.exe
2.* 测试版本(较新):/dl/Fiddler2BetaSetup.exe
在线帮助及视频教程:/Fiddler/help/
官方扩展列表:/Fiddler2/extensions.asp
系统要求: Windows 2000 / XP / 2003 / Vista 操作系统, Microsoft .NET Framework v2.0 或更高版本
浏览: 145632 次
来自: 杭州
啊,我也遇到了这个问题,楼主后面怎么解决了的啊
怎么引用呢,能更具体的写出来吗?
你好,这个问题我也出现了。 你是怎么解决的啊???????
楼主不能写一个简单的html吗,自己去实验怎么用!!!!!浏览器最近莫名出了问题,系统查过好像没有病毒,请高人指教。_百度知道
浏览器最近莫名出了问题,系统查过好像没有病毒,请高人指教。
请高手指教: 1011打开浏览器不管是IE的还是火狐的不管是在Windows xp还是在win7下面偶尔会出现上面的文字提示或者有时候就是乱码: -1000 Cache-Control: Thu1, 25 Nov 2010 21: close Date.43 Content-T2: no-cache Chtml Expires: text&#47.0:36.1 200 OK Server:43 GMT Content-Length,在此谢过: Apache&#47
提问者采纳
2,在返回值的时候确定你是不是要弹广告本身就是一个流氓行为.部分代码是通过此方式检测你内网电脑数因为这个是写在他们路由器里面的,可以说是劫持了我们的HTTP起的作用是在访问网站的时候1.弹出广告窗口
提问者评价
电信问题,谢谢
其他类似问题
系统重新恢复一次解决的办法,重新安装浏览器 再试。然后再重新安装浏览器。或者用360急救箱修复一下系统后
浏览器的相关知识
其他1条回答
是网业错误的原因。。数据传输错误也会出现这种情况。 有的时候刷新一下就好了
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁Apache 2 and PHP 5 (mod_php) on Linux - wokaotesting - 51Testing软件测试网 51Testing软件测试网-中国软件测试人的精神家园 - Powered by X-Space
-----------------------你站在桥上看风景--------------------------------------------I---------------------------------------------------------------------------------------看风景人在楼上看你-----------------------------------------Love---------------------------------------------------------------------------------明月装饰了你的窗子-----------------------------------------China---------------------------------断章----------------------------------------你装饰了别人的梦--------rokanio--------
Apache 2 and PHP 5 (mod_php) on Linux
& 16:19:38
/ 个人分类:
The following notes are how I got Apache 2 and PHP 5 (or PHP 4) working together on . 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&&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
source from the& 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 \
--enable-usertrack \
--enable-deflate \
--enable-ssl \
--enable-mime-magicYou only need the&enable-so&line above. For information on other options, type&./configure --help&and see "Compiling and Installing" in the&&Make Apache from the just-created&Makefile:makeIf make is successful, install Apache as root:make installDownload/unpack PHP source from the&&Pick the latest from the 4.x series or 5.x series.&In the PHP source directory, create a&Makefile&by typing:./configure \
--with-apxs2=/usr/local/apache/bin/apxs \
--with-mysql \
--prefix=/usr/local/apache/php \
--with-config-file-path=/usr/local/apache/php \
--enable-force-cgi-redirect \
--disable-cgi \
--with-zlib \
--with-gettext \
--with-gdbmYou only need the&--with-apxs2, and&prefix&lines.&--with-mysql&adds
(you need to specify the directory if it's in a unusual location (e.g., --with-mysql=/usr/local ),&--with-config-file&moves the php.ini file location,&disable-cgi&disables the CGI version, which is not needed if you use Apache modules. It also enables and installs the command line interface (CLI) version.&--with-zlib&allows use of gzip-type compression,&--with-gettext&is for internationalization, and&--with-gdbm&allows access to GDBM databases. For more information, type&./configure --help&and see the "Installation" chapter in the&&Make PHP from the just-created&Makefile:makeIf make is successful, type this as root to install PHP:make installIf you are not root (I do not perform. makes while root, for security and safety reasons), become root and type the following:make install-suIf file&/usr/local/apache/modules/libphp5.so&does not exist or is an older version, type this (change this to&libphp4.so&for PHP 4):cp -p .libs/libphp5.so /usr/local/apache/modulesInstall the php.ini file:cp -p php.ini-recommended /usr/local/apache/php/php.iniAdd these directives are in&/usr/local/apache/conf/httpd.conf&(if already there, verify they are correct):# Make sure there's only **1** line for each of these 2 directives:
# Use for PHP 4.x:
#LoadModule php4_module
modules/libphp4.so
#AddHandler php-script. php
# Use for PHP 5.x:
LoadModule php5_module
modules/libphp5.so
AddHandler php5-script. php
# Add index.php to your DirectoryIndex line:
DirectoryIndex index.html index.php
AddType text/html
# PHP Syntax Coloring
# (optional but useful for reading PHP source for debugging):
AddType application/x-httpd-php-source phpsNote 1: The php documentation recommends&AddType application/x-httpd-php php&instead of the above. However, it causes problems with the "MultiViews" feature of HTTP. That is, if the .php extension is left off a URL, and with certain browser&Accept&headers, Apache will not know .php (application/x-httpd-php) is HTML and will return a&406 Not Acceptable&error. Using the&AddType&and&AddHandler&as shown above fixes this problem. For details see Mark Tranchant's webpage, "," and&.Note 2: PHP Syntax coloring isn't required, but it's very nice for looking at your php source while debugging.&.Note 3: just for completeness I'll mention that you should be able to use&SetOutputFilter&/&SetInputFilter&instead of&AddType, but you can't use both. However,&SetOutputFilter&/&SetInputFilter&no longer works for me. It used to work with an earlier PHP 4.x or Apache 2 version, but not with Apache 2.0.47/PHP 4.3.3. I understand this (PHP as an Apache 2 filter) is experimental, so I don't use it anymore:&Files *.php&
SetOutputFilter PHP
SetInputFilter
&/Files&You're now ready to try it out. Start Apache (httpd) as root:/usr/local/apache/bin/apachectl startPerform. these sanity checks to verify your install went OK:$/usr/local/apache/bin/httpd -tSyntax OK
$/usr/local/apache/bin/httpd -vServer version: Apache/2.2.2
Server built:
May 29 :55
$/usr/local/apache/bin/httpd -VServer version: Apache/2.2.2
Server built:
May 29 :55
Server's Module Magic Number:
Server loaded:
APR 1.2.7, APR-Util 1.2.7
Compiled using: APR 1.2.7, APR-Util 1.2.7
Architecture:
Server MPM:
yes (variable process count)
Server compiled with....
-D APACHE_MPM_DIR="server/mpm/prefork"
-D APR_HAS_SENDFILE
-D APR_HAS_MMAP
-D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
-D APR_USE_SYSVSEM_SERIALIZE
-D APR_USE_PTHREAD_SERIALIZE
-D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
-D APR_HAS_OTHER_CHILD
-D AP_HAVE_RELIABLE_PIPED_LOGS
-D DYNAMIC_MODULE_LIMIT=128
-D HTTPD_ROOT="/usr/local/apache"
-D SUEXEC_BIN="/usr/local/apache/bin/suexec"
-D DEFAULT_PIDLOG="logs/httpd.pid"
-D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
-D DEFAULT_LOCKFILE="logs/accept.lock"
-D DEFAULT_ERRORLOG="logs/error_log"
-D AP_TYPES_CONFIG_FILE="conf/mime.types"
-D SERVER_CONFIG_FILE="conf/httpd.conf"
$/usr/local/apache/bin/httpd -SVirtualHost configuration:
$/usr/local/apache/bin/httpd -lCompiled in modules:
$/usr/local/apache/bin/httpd -MLoaded Modules:
php5_module (shared)
(the above works for Apache 2.2.x and higher only)
$ps -ef |grep httpdroot
00:00:08 /usr/local/apache/bin/httpd -k s
00:00:00 /usr/local/apache/bin/httpd -k s
. . .Note: on BSD-based UNIX systems, you need to use "ps -aux" instead of "ps -ef".Access your webserver with telnet. Type&HEAD / HTTP/1.0&followed by a blank line:$telnet localhost 80Trying 127.0.0.1...
Connected to localhost (127.0.0.1).
Escape character is '^]'.HEAD / HTTP/1.0HTTP/1.1 200 OK
Date: Mon, 29 May :18 GMT
Server: Apache/2.2.2 (Unix) mod_ssl/2.2.2 OpenSSL/0.9.7a PHP/5.1.4
X-Powered-By: PHP/5.1.4
Last-Modified: Wed, 15 Mar :17 GMT
Vary: Accept-Encoding
Connection: close
Content-Type: text/ charset=ISO-8859-1
Content-Language: en
Connection closed by foreign host.Access your webserver with your favorite browser. The following is a good
page to use for PHP. You only need the one line in&bold&is needed to display PHP configuration information. Name the file anything you want, but it&must&end with&.php, such as&phpinfo.php, and move the file to your
server content directory (for me&/usr/local/apache/htdocs), with read permission set:&html&
&title&PHP Test&/title&
&meta. http-equiv="Content-Type" content="text/ charset=ISO-8859-1"&
&h1&PHP Test&/h1&
&b&An Example of PHP in Action&/b&&br /&
&?php echo "The Current Date and Time is: &br&";
echo date("g:i A l, F j Y.");?&
&h2&PHP Information&/h2&
&p&&?php phpinfo(); ?&&/p&
&/html&• Disabling Existing Apache SoftwareIf Apache is already installed with your Linux distribution you have to disable it before installing your own custom version. To do this, type the following under RedHat Linux:/sbin/chkconfig --del httpd
/etc/init.d/httpd stopYou may also remove the&httpd&and&php&rpm packages, and dependent packages, if you wish.• Automatic Startup of ApacheTo start Apache automatically, follow these steps:Copy Apache startup file to the startup directory:cp /usr/local/apache/bin/apachectl /etc/init.d/Edit&/etc/init.d/apachectl&by inserting these 2 lines in&bold:#!/bin/sh
## chkconfig: - 85 15
# description: Apache is a Web server used to serve HTML files and CGI.#
# Copyright
The Apache Software Foundation or its licensors, as
# applicable.
# Apache control script. designed to allow an easy command line interface
# to controlling Apache.
Written by Marc Slemko,
. . .Enable httpd to startup automatically:/sbin/chkconfig --add apachectl
/sbin/chkconfig --level 2 apachectl onThis works for RedHat Linux, Mandrake, SuSE, and Sun Java Desktop System. The equivalent of&chkconfig&for Debian is:&update-rc.d apachectl defaults&For other distributions, make appropriate softlinks to directories&/etc/rc*.d/&Reboot Linux to verify Apache starts[Thanks to Beriah Dutcher and others]•&Make&doesn't make dynamic library&libphp5.so, just static library&libphp5.aFirst make sure libphp5.so isn't there. It's usually in the libs or .libs subdirectory. Run find from the PHP source directory root:&find . -name libphp5.soIf that doesn't work, make sure you use the&--with-apxs2&option with the correct directory in&./configure. For example:&./configure --with-mysql --with-apxs2=/path/to/apache/apxs&When re-running&./configure&always start with a fresh, clean source directory (no object).(For PHP 4, substitute&libphp4.so&and&libphp4.a&for&libphp5.so&and&libphp5.a, respectively.)•&PHP 5: My PHP scripts that worked with PHP 4 now ignores input variablesIf you have old PHP 4 scripts you don't want to convert to PHP 5, change this line in your php.ini file:register_long_arrays = OnFor the long term, you may want to upgrade your PHP software or convert the PHP source code to use new-style. variables. E.g., use&$_REQUEST[i]&instead of&$i•&PHP 5.2.0 Upgrade from 5.1.x&(November 2006)I had one problem with upgrading from PHP 5.1.x to 5.2.0. The Phorum 3 software I use has a function&date_format&that now conflicts with a new PHP 5.2 internal function, also called&date_format. This new function is used for PHP 5.2.x's new "datetime support". I fixed this by renaming Phorum's&date_formatfunction to not conflict with PHP's function. See also&&for more PHP 5.2 upgrade information.•&PHP 5.x: you may need to upgrade libxml2 to use XMLTo use PHP 5 and XML (--with-xml), you need the libxml2 library version 2.6.0 or greater. You may need to upgrade if you have an older Linux distribution. Check with&rpm -q libxml2&If it's not installed, check your installation disks for the libxml2 package. If it's too old, you can get the library from&. You will probably need to compile and install it yourself.•&PHP 4.3.5 / 4.3.6 / 5.0RC1 PCRE Regression&(March 2004)If you use PHP 4.3.5, 4.3.6, or PHP 5.0 RC1 with PCRE (Perl Regular Expressions, the default), you get a core dump when you try and restart (SIGHUP) Apache (at least with Apache 2.0.49). The cause is from adding a new version of PCRE, 4.5, in PHP. This is fixed in PHP 4.3.7 and 5.0.The symptom are these messages in error_log (which is also a symptom for lots of other memory-type bugs in Apache):[Wed Mar 31 17:14:43 2004] [notice] SIGHUP received.
Attempting to restart
[Wed Mar 31 17:14:43 2004] [notice] seg fault or similar nasty error detected in the parent process
[Wed Mar 31 17:14:48 2004] [warn] pid file /var/run/httpd.pid overwritten -- Unclean shutdown of previous Apache run?To fix, upgrade to PHP 4.3.7 or higher, which fixes it (PHP 5.0 or higher also fixes the bug). A workaround is to stop/start Apache, instead of restarting Apache. For details, see&.•&ServerRoot&Installation DirectoryBy default, Apache is installed in ServerRoot, as specified in httpd.conf or the httpd -d option:&ServerRoot "/usr/local/apache"&Some packagers and distributions move the location to&/usr/local/httpd&or&/usr/local/apache2&so check that Apache is installed where you say it is, and check that you don't have two separate Apache installations by mistake.•&PHP-required Apache files must be presentPHP expects certain files to be present. They may be missing for some Linux distributions, which tend to separate files among the&/var,&/etc, and other directories. The&apxs&program expects to find httpd under the&bin&directory where apache is installed (by default&/usr/local/apache/bin). PHP expects to find the&os.h&and&unixd.h&header files under the&include&directory where apache is installed (by default&/usr/local/apache/include).•&MySQLUse the&--with-mysql&configure option to build PHP with PHP's version of MySql. If you want the system's MySQL, or are also using MySql with another apache module (e.g., mod_perl), use this:&with-mysql=/usrMake sure the MySQL developent headers are installed. This is usually package&mysql-devel&(thanks to Dev for the tip)•&Custom OpenSSL and SSLWhen using "--enable-ssl" (i.e, build with OpenSSL), the configure script. will try to guess the location of OpenSSL. If you're using your own custom SSL, you must specify the location. For example, "--with-ssl=/usr/local/ssl" (of course, you can use the SSL and PHP that comes with Redhat 9 and other distributions).Please note that mod_ssl is only for Apache 1.x. Apache 2.x does not use mod_ssl—SSL is built into Apache 2.x.Jason reports that with RedHat 9 on his system, the make failed at mod_ssl. It needed a missing krb5.h header file. The fix is to Add an environment variable, $CFLAGS, before making PHP. That is:&"-I/usr/kerberos/include/ -L/usr/kerberos/lib"•&gdbm&If you get this error when using "--with-gdbm":&configure: error: DBA: Could not find necessary header file(s).&then you are probably missing the gdbm-devel rpm package.•&Apache 1.x and Apache 2 Configuration Directives&The "AddModule," "AgentLog," "ReferrerLog," "RefererIgnore," "BindAddress," "ClearModuleList," "Port," "FancyIndexing," "ServerType," "AccessConfig," and "ResourceConfig" directives in Apache 1.x&no longer exist&in Apache 2. Also, "HAVE_*" httpd.conf definitions no longer exist. Comment them out of your httpd.conf for Apache 2. Most of these directives have been replaced by other directive(s).•&Error after glibc library upgradeApache should still work after upgrading glibc with security and bug fixes for the same release. If you use another architecture (say from or to i386/i686), you need to recompile. One symptom is an error like this in your Apache error_log:&[error] (38)Function not implemented:•&make cleanKåre Olaussen adds this note: If you're compiling php4 for both Apache 1.3 and Apache 2, use a separate php source directory for each version of Apache. "The module wouldn't load into Apache 2, because I had forgotten to run make clean in between." [Ed. note: I recommend untaring the source from scratch in another directory, that way you are sure no old state information is left behind from previous makes. Do this for any configuration or version changes.]•&Enabling&register_globals&for Apache 2From Duke: For those of you that are desperately trying to enable&register_globals&on a per-directory basis using Apache 2 with PHP 4 [or PHP 5] using.htaccess&files, the syntax is different from Apache 1.x. In the directory you want to enable&register_globals&(or pretty much any other on/off setting), add an&.htaccess&file containing:php_value register_globals 1Note that&php_flag&does&not&work with Apache 2. Neither does&on&/&off&— you must use&0&(off) or&1&(on).[Editor's note: To enable globally, add&register_globals=off&to your&php.ini&file.]To enable&register_globals&on a per-directory basis, you can add to a&&Directory&&stanza or create a&.htaccess&configuration file in the directory. To use.htaccess, you must first enable it by adding&AllowOverride All&(or some combination of&AllowOverride&options within the correct&&Directory&&stanza. Also newer PHP software, such as SquirrelMail, no longer require&register_globals&to be enabled. Keeping&register_globals&disalbed makes the system much more secure (as it's harder to set internal php variables through submitting html forms). ]•&Multi-Processing Module (MPM): don't use multi-threading MPMsMPMs is how Apache 2 handles multiple web server requests. That is, with multiple processes or multiple threads or some combination. For now, on Linux (and even UNIX) you should only use the (default) prefork module with PHP. This is specified at compile time. Other MPM modules (any involving threads) break PHP. This is partly because PHP uses a great number of external libraries, and many or most of them are not thread-safe or thread-aware. In any case, Linux 2.4 doesn't handle threads efficiently yet—multiple processes are better (this changes with Linux 2.6, or RedHat 9 with 2.6 threads backported to Linux 2.4).•&API module structure `php5_module' in file . . . is garbledIf you get a message like this:&httpd: Syntax error on line 195 of /usr/local/apache/conf/httpd.conf: API module
structure `php5_module' in file /usr/local/apache/modules/libphp5.so is garbled
- perhaps this is not an Apache module DSOit's because your version of PHP wasn't built for the version of Apache you are using (For PHP 4, substitute&php4_module&. . .&libphp4.so). Recompile PHP in a "fresh" source directory (where you haven't built PHP before) and make sure&--prefix,&--with-config-file&and&--with-apxs2&points to the correct Apache directories you are using and the&libphp4.so&file has been copied to your&/usr/local/apache/modules&directory.•&PATH_INFODan Fitzpatrick notes that he uses PATH_INFO for many PHP scripts like&/index.php/go/do/something&(where parameters are passed to PHP as "fake" subdirectories). He received a&404 Not Found&errors with Apache 2 but not Apache 1.3.27. He had to add "AcceptPathInfo On" to file&httpd.conf. For details, see•&Using&&? & ?&&style. tags in addition to&&?php & ?&&style. tagsIf you want to also use the old-style. (or MS ASP-like) tags&&?&and&?&&then add this line to your&php.ini&file. This is the default starting with PHP 5:&short_open_tag = On•&GD library now built-in PHPPHP 4.3.0 has gd built-in, just pass&--with-gd&to PHP configure.•&--with-apacheIf you don't have Apache source at the default directory at&/usr/local/apache, then use&--with-apache=DIR&with PHP configure, where DIR is the root source directory, This tells PHP where to look for the Apache source.•&Redhat 9&Apache 2 and PHP is built-in RedHat 9 (packages httpd 2.0.40, and php 4.2.2). Apache is mostly under&/usr/lib/httpd&and&/usr/sbin/httpd. PHP is at/usr/lib/httpd/modules/libphp4.so&For a complete file listing, type:&rpm -ql httpd phpFor RedHat 9, PHP 4.3.1 gives a compiler errors with RedHat 9 similar to:&my_malloc.c:24: undefined reference to `errno'&The problem is w}

我要回帖

更多关于 apache php mysql 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信