How to install the PHP development environment? Php environment installation configuration _ PHP Tutorial

Source: Internet
Author: User
Tags apache php php development environment
How to install the PHP development environment? Install and configure the php environment. How to install the PHP development environment? this may be a troublesome task for php beginners. He needs to install php, mysql, apache or phpmysqliis. The first one is introduced in the following small series. How can I install the PHP development environment? this may be a troublesome task for php beginners. He needs to install php, mysql, apache or php mysql iis, the following section describes the first one.

Build a PHP development environment
Time: 8.1
Requirements:

Install the php environment manually (the integration environment is not counted. it can only be used in winow. it can be used as a reference for linux, but can be used in linux ).
Including mysql + php + apache + phpadmin. the version is not limited. web testing is required.
Install and develop the 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


References:
Http://www.php.net/manual/zh/install.unix.php
Http://www.php.net/manual/zh/install.pecl.php

Follow-up content: phpinfo, the installation is unsuccessful, mainly depends on this!

==============================================

1. installation sequence in windows for apache, mysql, and php
A: apache and mysql must be installed before php. the installation sequence of apache and mysql is random.

2. if php_curl extension is enabled, why does the system still prompt that the curl service is not enabled? how can this problem be solved?
A: restart apache after the libeay32.dll, ssleay32.dll, php5ts. dll, and php_curl.dll files in the PHP directory are under the system32 directory.

3. in windows, how do I enable php to work in apache2.x?
Answer: handler, cgi, fastcgi

Note: The general module is installed as handler.

==========================================================

1. After apache php is configured, enter http: // localhost in the browser. the default page DirectoryIndex is not configured.

2. this problem occurs when downloading the PHP package. the php5apache2_2.dll extension is not available in the downloaded PHP package because there are two types

3. when configuring apache PHP, I usually add two sentences.
LoadModule php5_module E:/PHP/php-5.2.10/php5apache2_2.dll # PHP Directory
AddType application/x-httpd-php. php # file type for executing php
However, sometimes an error is reported to see if there are more than spaces in the two sections added, and there are spaces behind x-httpd-php.

========================================================== ======

1. in windows, when php and apache are configured in combination, the configuration file of php and apache is modified, and apache is restarted. how can I solve the "the requested operation has failed" problem?
A: When the preceding error occurs, you cannot determine the problem. you can use the doc command to find out the cause of the error. First, you need to enter the directory where apache is located and then run the following command: httpd.exe-w-n "Apache2.2"-k start
Detailed information is provided below.
Note: Make sure that the php5_apache2_2.dll file in the php directory exists;
Introduce this file when configuring apache and specify it to the correct directory;
When editing apache configuration, pay attention to the space issue. if there are extra spaces, it may cause errors;

Note: I feel that you have no connection between php and apache, but it is not clear.

2. how to configure the server to handle only get and post requests when installing the php + apache + mysql development environment in windows?
A: the configuration file for apache configuration is as follows:

Deny from all

Annotation: this is not found

3. after myql is installed, "Start service" cannot be displayed. why?
A:

<1. it appears on a previously installed mysql server. to solve this problem, ensure that the previously installed mysql server is completely uninstalled;
<2. check whether the previous password has been modified as described in the previous step. if you reinstall the password and have already set it, changing the password may cause an error. leave it blank, remove the check box before "Modify Security Settings" and change the password after the installation and configuration is complete;
<3. back up and delete the data folder under the mysql installation directory. after the installation is complete, delete the generated data folder and the backup data folder, restart the mysql service. in this case, you may need to back up the previous database;

Note: I don't know if I'm right. it seems that I have installed mysql, but another one will conflict.

========================================================== =

1. add debugging code
Create a debug. php file. The $ _ GET and $ _ POST values can be added. In php. ini, set "export de_path =" c:/php "and put debug. php in this folder.
If you want to add a public header and tail file, you can:
Find Automatically add files before or after any PHP document in ini.

Auto_prepend_file = auto_prepend_file.php; // attach to the header
Auto_append_file = auto_append_file.php; // it is attached to the end

2. how to make Html/PHP strings not interpreted, but displayed as they are
Example:
PHP ";

The code is as follows:
Echo "interpreted:". $ str. "processed :";
Echo htmlentities (nl2br ($ str); // output after two conversions.
?>

3. how to configure the GD Library
1: Copy all dll files in the dlls folder to c: windowssystem32 in the system32 directory
2: Open php. ini
Set extension_dir = "c:/php/extensions /";
3: extension = php_gd2.dll; remove the comma before extension. if php_gd2.dll is not available, the same applies to php_gd.dll. ensure that the file c:/php/extensions/php_gd2.dll exists.

Note: generally, environment variables are used. you do not need to test the dlls folder in c: windowssystem32.

========================================================== ============= Yi

1. Can I use if to determine whether the $ _ POST global variable has passed parameters?
A: isset () is recommended. if is a judgment statement. The variables in it must have been defined, so if is not used.
Annotation: a global variable, also known as an external variable, is a variable defined outside the function.

Note: isset () determines whether the variable has been declared, and then judges other variables. If you are lazy, you can use empty ()

$ _ POST is a global variable, which indicates that it has been defined and can be used.

2. what content is submitted when a form is submitted?
A: At the time of submission, the name and value attributes of the tag are submitted, where name is used as the key value and value is used as the array element. if the tag does not have the name attribute, it will not be submitted.

Note: I don't know what your submission means, but I know that if there is a submission address, he will find that address, and the value after submission is blank. Does that mean this?

Note: when submitting a form, if it is get, it is get. if it is post, there is a difference in the encoding method! Pay attention to it! In addition, some have names but no values, and isset () cannot be used to obtain the truth.


3. what is a session?
A: When a user accesses a website, a session is established to communicate with the server. when all the pages of the website are closed, the session ends and the session is released.

Annotation: for WEB development, a session is a call between the browser and the server, but this call is implemented through browser browsing.

I am from Baidu, but I don't know either. But it looks like that, tom explained.

Note: A session is a session maintained between the browser and the server. The session is not global but global. In general, this will be the browser lifecycle, the browser is closed, and the session ends! Of course, this can also be configured. See the session section in php. ini. When you open a new window, a new session is started, but you open a new window from the old window without generating a new session (measurable ).

========================================================== ====================

1. can two machines in the LAN access apache from each other?
Yes
Modify the configuration of httpd. conf.
The ip address is 192.168.0.1 (this is an intranet ip address of the LAN)
Modify the Listen configuration
Listen 192.168.0.1: 80 and then restart apache
In addition: first, the firewall of the server should be shut down. if you use the XP system, the firewall that comes with the system must be shut down.
Second, configuration problems

The code is as follows:

Order allow, deny
Allow from all

Note: 1. if the ip address is 192.168.0.1 (this is a LAN intranet ip address), should it be added to WindowsSystem32driversetchosts?

Tom note: the domain name configuration only directs the local domain name to which IP address, but during access, the host name will also be taken back!

The server needs to configure the virtual host monitoring IP address and distribute the traffic according to the host name before access.

2. why modify the Listen configuration?

Note: indicates which port the server listens.

2. is there any other php Extension library out of ext? For example, where can I find the dll used to connect to a database outside mysql?
There are many extension libraries, such as curl, which can also be written by yourself. Php_dba.dll and php_oci8.dll should be included in php and should be commonly used in php/ext.

Note: in addition to the built-in dll library in the window, other users or self-compiled dll. there is a way to compile it in the manual.

3. how does php publish a complete website project (windows/linux/unix) and put it directly under the www directory?
Answer (online query)
A. direct release of the code repository
Svn export ....
B. If there are many servers,
(1) svn export...
(2) then push to other servers, rsync ....

Annotation: not readable

Note: You only need to send it.
========================================================== ====================

1. process of apache, mysql, and php in windows
A: First install apache or mysql database. after both are installed successfully, install php

2. after the installation is complete, build a local link to the online project. because the database link uses pdo, how can I enable the pdo extension?
A: Copy the php_pdo.dll file in the PHP directory to the system32 directory, open php. ini, find extension = php_pdo.dll, and remove the semicolon before extension.

3. how to access a local project with a local custom domain name, such as building a local substation project
A: custom links. for example, if the access address is bendi.homelink.com.cn, open the directory C: WINDOWSsystem32driversetc, find the hosts file and open it, add 127.0.0.1 bendi.homelink.com.cn to the last line, and!
Then open httpd. conf to edit and add:

The code is as follows:
NameVirtualHost *: 80

ServerAdmin email address
DocumentRoot project storage path
ServerName bendi.homelink.com.cn

Save and close it. then restart apache and the browser to access it directly with a custom domain name.

Using mysql iis, the first one will be introduced below ....

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.