PHP programming often need to use some of the server's information, special $_server detailed parameters to organize, convenient for later use.$_server[' php_self '] #当前正在执行脚本的文件名, related to document root. $_server[' argv '] #传递给该脚本的参数. $_server[
$ _ SERVER ['php _ SELF '] # File Name of the script being executed, which is related to document root.$ _ SERVER ['argv'] # parameters passed to the script.$ _ SERVER ['argc '] # contains the number of command line parameters passed to the Program (
Summary of common predefined variables in php. Copy the code as follows :? Phpecho current operating system information. PHP_ OS .br; echo path and FILE name of this FILE:. _ FILE _. br; echo current PHP version information. PHP_VERSION.br
The code
Php retrieves the current url and replaces the parameter or url. First, PHP retrieves the URL of the current page: Copy the code as follows: get the current script URL functionGetCurUrl () {if (! Empty ($ _ SERVER [REQUEST_URI]) {$ scriptName $ _
1 Preface I have tested the stress of apache, lighttpd, and nginx web servers over the past few days. Apache runs in apache module and lighttpd and nginx runs in fastcgi mode. The basic test result is that apache is slow to reflect, and the
This article mainly introduces four common php running methods. This article describes CGI, FastCGI, APACHE2HANDLER, CLI, and other four running methods. if you need them, refer to SAPI: server Application Programming Interface Server Application
The apache module mod_rewrite provides a rewrite engine based on the regular expression analyzer to rewrite URL requests in real time. It supports a flexible and powerful URL operation mechanism for each complete rule with unlimited number of
PHP $ _ SERVER details. The copy code is as follows: $ _ SERVER [HTTP_ACCEPT_LANGUAGE] browser language $ _ SERVER [REMOTE_ADDR] Current user IP address. $ _ SERVER [REMOTE_HOST] Current User host name $ _ SERVER [
The code is as follows:
$ _
PHP is a cross-platform server-side embedded scripting language. It relies heavily on the syntax of C, Java, and Perl, coupled with PHP's own features, so that WEB developers can quickly write dynamic pages. The latest version of PHP5.01 supports
The PHPURL address obtains the function code (port, etc.). after reading this code, you can directly use it instead of reading it. Php obtains the current script URL (only Path)
The code is as follows:
Function GetCurUrl ()
{
If (! Empty ($ _
Some SERVER information is often used in PHP programming. the detailed parameters of $ _ SERVER are sorted out for future use. Some SERVER information is often used in PHP programming. the detailed parameters of $ _ SERVER are sorted out for future
There are three ways for PHP to work in Apache: CGI mode, Apache module DLL, FastCGI mode, and I. CGI mode: CGI mode in Apache2. Edit the Apache configuration file httpd. conf as follows: # ScriptAliasphpD in PHP4: php Apache
There are three ways
WhichPHPmode? ApachevsCGIvsFastCGI and apachefastcgi. WhichPHPmode? ApachevsCGIvsFastCGI, apachefastcgiWhichPHPmode? ApachevsCGIvsFastCGITherearemultiplewaystoexecutePHPscriptsonawebserver. Wereoftenaskeda Which PHP mode? Apache vs CGI vs FastCGI,
$ _ SERVER array element description bitsCN.com
$ _ SERVER array element description
$ _ SERVER ['php _ SELF '] # file name of the script being executed, which is related to document root.
$ _ SERVER ['argv'] # parameters passed to the script.
$ _
I. Working Mode of php
Php has three working modes in the lamp environment: CGI Mode, apache module, and FastCGI mode. Running PHP in CGI Mode has poor performance. Run as an apache module. Compile and install lamp in the previous log. The FastCGI
Apache is one of the most popular Web server-side software that uses a very extensive web server, multi-platform support. Apache is fast, reliable, and can be augmented with a simple API to integrate language interpreters such as Php/python. This
In PHP-making projects, it is common to separate the header from the footer. Page header navigation in the selected state will have some style, such as active, when the page in the homepage, the homepage of the navigation should also be the active
First, PHP retrieves the URL of the current page:Copy codeThe Code is as follows:// Obtain the current Script URLFunction GetCurUrl (){If (! Empty ($ _ SERVER ["REQUEST_URI"]){$ ScriptName = $ _ SERVER ["REQUEST_URI"];$ Nowurl = $ scriptName;}Else{$
Variable: $ _ SERVER, used in PHP 4.1.0 and later versions. For earlier versions, use $ HTTP_SERVER_VARSVariable: $ _ ENV, used in PHP 4.1.0 and later versions. For earlier versions, use $ HTTP_ENV_VARSVariable: $ _ COOKIE, used in PHP 4.1.0 and
This article mainly introduces four common php running methods. This article describes CGI, FastCGI, APACHE2HANDLER, CLI, and other four running methods. For more information, see
This article mainly introduces four common php running methods. This
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.