How to install PHP development environment, this for PHP beginners may be a more troublesome thing, he needs to install Php,mysql,apache or PHP MySQL IIS Oh, the following small part to introduce the first kind.
Build a PHP development environment
Duration: 8.1 Days
Requirements:
Manual installation of the PHP environment (integrated environment does not count, only Winow, Linux for reference, but the problem can be found under Linux).
Includes Mysql+php+apache+phpadmin, version Unlimited. Required to be able to conduct Web tests.
Installation of the development IDE, including (Zend 5+ editplus+emeditor+dreamweaver)
Manual:
http://www.php.net/manual/zh/install.windows.php
http://www.php.net/manual/zh/install.windows.apache2.php
http://www.php.net/manual/zh/install.windows.extensions.php
Reference content:
http://www.php.net/manual/zh/install.unix.php
http://www.php.net/manual/zh/install.pecl.php
Attention content: Phpinfo, installation success is unsuccessful, mainly to see this!
======================================
1, Apache, MySQL, PHP installation sequence under Windows
A: Apache, MySQL to install in front of PHP, Apache and MySQL installation sequence is arbitrary
2, opened the Php_curl extension, why will also prompt does not turn on the Curl service, how to solve?
A: Libeay32.dll in PHP directory, Ssleay32.dll, Php5ts.dll, Php_curl.dll file to system32 directory, restart Apache
3. Three ways to make PHP work in apache2.x under Windows?
Answer: Handler, CGI, fastcgi
Note: The general module is installed as handler
========================================
1, when the configuration of Apache PHP after the browser input http://localhost page is not appropriate because the default page is not configured DirectoryIndex
2, download PHP package will have this problem in the downloaded PHP package does not have php5apache2_2.dll extension, because there are two kinds of download package
3, Apache PHP configuration will generally add two words
LoadModule Php5_module E:/php/php-5.2.10/php5apache2_2.dll #PHP目录
AddType application/x-httpd-php. PHP #执行php的文件类型
But sometimes the cause of the error is to see if the addition of two paragraphs more than a space, x-httpd-php behind a space
==============================================
1.windows under the installation environment, PHP and Apache configuration, modified PHP and Apache configuration file, restart Apache, "The requested operation has failed" How to solve?
A: The above error, unable to determine which problem, you can use the Doc command to find the cause of the error, first to enter the directory of Apache, and then typed command: HTTPD.EXE-W-n "Apache2.2"-K Start
More information is available below.
Note: Ensure that the PHP directory below the Php5_apache2_2.dll file exists;
When configuring Apache, note that this file is introduced and assigned to the correct directory;
When editing the Apache configuration, note the space problem, if there are extra spaces, may cause errors;
Comments: Feel your ask you are PHP and Apache did not establish a connection, not clear
2.windows Install the Php+apache+mysql development environment, how do I configure the server to handle only get and post requests?
A: Configure the Apache configuration file as follows:
Deny from all
Comment: This is not found.
3.MYQL installation completed, there is no "Start service", which is why?
For:
<1. Appears in the previous installation of MySQL server, the solution, the first to ensure that the previous installation of the MySQL server completely uninstalled;
<2. Check whether the previous password has been modified as described in the previous step, if it is re-installed, and the password has been set previously, change the password here may be error, please leave blank, and the "Modify Security Settings" Before the check out, the installation configuration after the completion of a separate password change ;
<3. Back up the Data folder in the MySQL installation directory, then delete, after the installation is complete, will install the generated Data folder deleted, the backup Data folder is moved back, and then restart the MySQL service can be, in this case, may need to put the previous database backup;
Comment: I don't know if it's right, it sounds like you've already installed MySQL, but it's a conflict.
==========================================
1, adding debug code
Create a debug.php file. You can add $_get,$_post equivalents. Then set in php.ini: include_path = "c:/php" and place the debug.php in this folder.
If you want to add a common Kinsoku file, you can:
Find automatically add files before or after any PHP document in INI.
Auto_prepend_file = auto_prepend_file.php; Attached to the head
Auto_append_file = auto_append_file.php; Clinging to the tail
2, how to make html/php format strings not interpreted, but displayed as is
Example:
PHP ";
The code is as follows |
Copy Code |
Echo "was explained:". $str. " After treatment: "; Echo htmlentities (NL2BR ($STR)); Two times the output after conversion. ?> |
3, how to configure the GD library
1: Copy all DLL files in the DLLs folder to the System32 directory C:windowssystem32
2: Open php.ini
Set extension_dir = "c:/php/extensions/";
3:extension=php_gd2.dll, remove the comma in front of the extension, and if not php_gd2.dll,php_gd.dll, ensure that the file does exist C:/php/extensions/php_ Gd2.dll
Note: General use of environment variables, do not need to DLLs folder to C:windowssystem32
=================================================== Berkelium Game
1, in judging whether the $_post global variable has passed the parameters, with if can?
A: It is recommended to use Isset (), if is a judgment statement, the variables inside must be already defined, so you cannot use if.
Annotation: A global variable is also known as an external variable, which is a variable defined outside the function.
Note: isset () Determine if the variable has no declaration and then judge the other. If lazy, you can use empty ()
$_post is a global variable, that means it's already defined, so it can be used
What content is submitted when the form is submitted 2,form?
A: When committing, the name and Value property of the tag is submitted, where name is the key value, value as the array element, and if the label does not have a name attribute, it is not committed.
Comment: I don't know what your submission means, but I know that if there is a commit address he will find the address and the value after submission is empty. Is that what it means?
Note: When the form is submitted, if it is get, it is get, if it is post, there is the difference between the encoding method! You can pay attention! In addition, some of the most certainly have name, but no value, with isset () do not get true.
3, what is a session?
A: When a user visits a Web site, a session is established to communicate with the server, and when all the pages of the entire site are closed, the session ends and sessions are released.
Annotations: In the case of web development, a session is a conversation between your browser and the server, except that the call is done in a browser-browsing way.
This is my Baidu, do not know, I do not understand. But it looks like that, and Tom explains it.
Note: A session is a session maintained between the browser and the server, and the session is not global and is user-wide. In general, this will be the browser life cycle, browser close, Session end! Of course this can also be configured. See the session section in PHP.ini. When you open a new window, a new session is launched, but you open the window from an old window, and you do not generate a fresh session (you can measure it).
=======================================================
1. Two machines in LAN Apache can visit each other
OK
Modifying the configuration of the httpd.conf is possible.
Join IP is 192.168.0.1 (this is a LAN intranet IP)
Modify the configuration of the listen to
Listen 192.168.0.1:80 and then restart Apache.
In addition: first, the server firewall to shut down, if you are using XP system, the system comes with a firewall must be off.
Second, configuration issues
The code is as follows |
Copy Code |
Order Allow,deny Allow from all |
Comments: 1. Join IP is 192.168.0.1 (this is a LAN intranet IP) is this supposed to be in windowssystem32driversetchosts?
Tom Note: The domain name configuration is only the domain name of the computer to which IP, but when accessed, will also be anti-host name with the past!
The server needs to configure the virtual host to monitor this IP, based on the host name to set up a shunt to access.
2. Why to modify the configuration of this listen
Note: Indicates which port the server listens to
2.php Extension Library is there anything else outside ext? For example, a DLL that connects to a database outside of MySQL, where do I find it?
There are many extension libraries, such as curl, which can also be written on your own. Php_dba.dll and Php_oci8.dll should be PHP's own, commonly used should be in the Php/ext.
Note: The DLL library under window, other than the one that comes with it, needs to be outside others or self-compiled DLLs. The manual has a method for how to compile.
3.php How to publish a complete Web site project (Windows/linux/unix), just put it in the WWW directory?
The answer (online check)
A. Code Warehouse Direct Publishing
On the server SVN export ....
B. If there are many servers,
(1) SVN export on a single publisher ...
(2) Then push to another server, rsync ....
Comment: Can't read
Note: As long as you can send on the line.
=======================================================
1, Apache, MySQL, PHP in the process of Windows
A: First install Apache or MySQL database, two are installed successfully, finally install PHP
2. Install the link online project after installation, how do I open the PDO extension because the database link uses PDO?
A: Copy the Php_pdo.dll file in the PHP directory to the system32 directory, then open php.ini to find extension=php_pdo.dll; Remove the semicolon from the front of the extension
3. How to access local projects in local custom domain names, such as local construction of the Sub-station project
A: Link customizations, such as define access address: bendi.homelink.com.cn, Open Directory: C:WINDOWSSYSTEM32DRIVERSETC, locate the Hosts file and open, add 127.0.0.1 in the last row bendi.homelink.com.cn, close Save!
After opening httpd.conf for editing, add:
The code is as follows |
Copy Code |
Namevirtualhost *:80 ServerAdmin e-mail address DocumentRoot Project Storage Path ServerName bendi.homelink.com.cn
|
The save is closed after joining, and then the Apache and the browser can be accessed directly with the custom domain name.
http://www.bkjia.com/PHPjc/632847.html www.bkjia.com true http://www.bkjia.com/PHPjc/632847.html techarticle How to install PHP development environment, this for PHP beginners may be a more troublesome thing, he needs to install Php,mysql,apache or PHP MySQL IIS Oh, the following small part to introduce the first kind. ...