How to install PHP development environment? PHP environment installation configuration_PHP tutorial

WBOY
Release: 2016-07-13 10:47:37
Original
1459 people have browsed it

How to install the PHP development environment? This may be a troublesome thing for PHP beginners. He needs to install php, mysql, apache or php mysql iis. The editor will introduce the first method below.

Build a PHP development environment
Time: 8.1
Requirements:

Manually install the php environment (the integrated environment does not count, only winow is enough, linux is used as a reference, but the question can also be asked under linux).
Including mysql+php+apache+phpadmin, the version is not limited. It is required to be able to perform web testing.
Install 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

Follow content: phpinfo, whether the installation is successful or not, mainly depends on this!

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

1. Installation sequence of apache, mysql, php under windows
Answer: apache and mysql must be installed before php. The installation order of apache and mysql is arbitrary

2. After the php_curl extension is enabled, why is it prompted that the curl service is not enabled? How to solve it?
Answer: After moving the libeay32.dll, ssleay32.dll, php5ts.dll, php_curl.dll files in the PHP directory to the system32 directory, restart apache

3. Three ways to make php work in apache2.x under windows?
Answer: handler, cgi, fastcgi

Note: Generally, the module is installed as handler

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

1. After configuring apache php, enter http://localhost on the browser. The page does not respond because the default page DirectoryIndex is not configured

2. There will be such a problem when downloading the PHP package. There is no php5apache2_2.dll extension in the downloaded PHP package. This is because there are two types when downloading the package

3. Two sentences are usually added when configuring apache PHP
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
But sometimes an error will be reported. The reason is to see if there are more spaces in the two paragraphs added. There are spaces after x-httpd-php

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

1. When installing the environment under Windows, when php and apache are combined and configured, the configuration files of php and apache are modified, and apache is restarted. How to solve the problem of "the requested operation has failed"?
Answer: When the above error occurs, it is impossible to determine which one is 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 type the command: httpd.exe -w -n "Apache2.2" -k start 
Detailed information will be provided below.
Note: Make sure the php5_apache2_2.dll file exists under the php directory;
When configuring apache, be sure to introduce this file and specify it in the correct directory;
Pay attention to the space problem when editing the apache configuration. If there are extra spaces, it may cause errors;

Annotation: I feel like your question is that there is no connection between php and apache at all, so it’s not very clear

2. How to configure the server to only handle get and post requests when installing the php+apache+mysql development environment under windows?
Answer: The configuration file for configuring apache is as follows:

Deny from all

Annotation: This one was not found

3. Myql installation is completed, but "Start service" cannot be displayed. Why is this?
Answer:

<1. It appears on a server where mysql was previously installed. The solution is to first ensure that the previously installed mysql server is completely uninstalled;
<2. Check whether the previous password has been modified as mentioned in the step above. If it is a reinstallation and a password has been set before, it may be wrong to change the password here. Please leave it blank and change "Modify Security Settings" Remove the previous check mark and change the password after the installation and configuration are completed;
<3. Back up the data folder in the mysql installation directory, and then delete it. After the installation is completed, delete the data folder generated by the installation, move the backed up data folder back, and then restart the mysql service. This way In some cases, you may need to back up the previous database;

Comment: I don’t know if this is correct, it sounds like mysql has already been installed, but installing another one will cause conflicts

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

1, add debugging code
Create a debug.php file. You can add $_GET, $_POST and other values ​​inside. Then set: include_path = "c:/php" in php.ini and put debug.php in this folder.
If you want to add public header and tail files, you can do the same:
Find in ini Automatically add files before or after any PHP document.

auto_prepend_file = auto_prepend_file.php; //Attach to the head
auto_append_file = auto_append_file.php; //Attach to the tail

2. How to prevent the string in Html/PHP format from being interpreted, but displayed as it is
Example:
PHP";

The code is as follows Copy code
Echo "Explained: ".$ str."Processed:";
代码如下 复制代码
Echo "被解释过的: ".$str."经过处理的:";
Echo htmlentities(nl2br($str)); //两次转换后输出。
?> 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 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 extension. If there is no php_gd2.dll, the same is true for php_gd.dll. Make sure that this file does exist c:/php/extensions/php_gd2.dll

Note: Generally use environment variables, there is no need to move the dlls folder to c:windowssystem32

================================================== ====锫奕


1. When judging whether the $_POST global variable has passed parameters, can you use if?
Answer: It is recommended to use isset(). If is a judgment statement, and the variables in it must have been defined, so if cannot be used.

Note: Global variables are also called external variables, which are variables defined outside the function.

Note: isset() determines whether the variable is declared, and then determines others. If you are lazy, you can use empty()

$_POST is a global variable, which means it has been defined, so it can be used


2. When submitting the form, what content is submitted?

Answer: When submitting, what is submitted is the name and value attributes of the label, where name is the key value and value is the array element. If the label does not have a name attribute, it will not be submitted.

Comment: I don’t know what your submission refers to, but I know that if there is a submission address, he will find that address, and the value after submission will be empty. Is that what you mean?

Note: When the form is submitted, if it is get, it is get, if it is post, there is a difference in encoding method! You can pay attention to it! In addition, some even have a name, but when there is no value, the truth cannot be obtained using isset().



3. What is a session?

Answer: When a user visits a website, a session is established to communicate with the server. When all pages of the entire website are closed, the session ends and the session is released.

Annotation: As far as WEB development is concerned, a session is a call between you and the server through the browser, but this call is implemented by browsing with the browser

This is my Baidu. I don’t know if it’s correct, and I don’t really understand it 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 level, but user global level. Under normal circumstances, this will be the browser life cycle, 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 will be started, but if you open a new window from an old window, a new session will not be generated (you can test this).

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


1. Can two Apache machines in the LAN access each other?
Yes
Just modify the configuration of httpd.conf.
The added IP is 192.168.0.1 (this is a LAN intranet IP)
Modify Listen configuration to
Listen 192.168.0.1:80 and then restart apache
In addition: First, the server's firewall must be turned off. If you are using an XP system, the system's own firewall must be turned off.

Second, configuration issues
 代码如下 复制代码

Order allow,deny
Allow from all
The code is as follows Copy code
Order allow,deny Allow from all

Annotations: 1. The added IP is 192.168.0.1 (this is a LAN intranet IP). Should this be added in WindowsSystem32driversetchosts?

Tom’s note: The domain name configuration only points the domain name of this machine to which IP, but when accessing, the host name will also be brought there!

The server needs to configure a virtual host to monitor this IP, and set up diversion according to the host name before it can be accessed.

2. Why should we modify this Listen configuration

Note: Indicates which port the server is listening on

2. Is there any other php extension library besides ext? For example, where should I find the DLL that connects to a database other than MySQL?
There are many extension libraries, such as curl, etc., or you can write your own. php_dba.dll and php_oci8.dll should come with PHP, and the commonly used ones should be in php/ext.

Note: Except for the dll library that comes with it, others need to compile the dll by others or themselves. The manual has how to compile it.

3.php How to publish a complete website project (windows/linux/unix)? Can it be placed directly in the www directory?
Answer (checked online)
a. Publish directly from the code repository
On the server svn export ....
b. If there are many servers,
(1) On a publishing server svn export ...
(2) Then push to other servers, rsync....

Comment: Can’t understand

Note: As long as it can be posted.
================================================== =====

1. The process of apache, mysql and php under windows
Answer: First install apache or mysql database. After both are successfully installed, finally install php

2. After the installation is completed, build the link online project locally. Since the database link uses pdo, how to enable the pdo extension?
Answer: Copy the php_pdo.dll file in the PHP directory to the system32 directory, then open php.ini and find extension=php_pdo.dll; remove the semicolon in front of extension

3. How to customize a local domain name to access local projects, such as building a local branch project
Answer: Link customization, for example, define the access address as: 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, close and save !
Then open httpd.conf for editing and add:

ServerAdmin email address
The code is as follows
 代码如下 复制代码
NameVirtualHost *:80
   
ServerAdmin 邮箱地址
DocumentRoot 项目存放路径
ServerName bendi.homelink.com.cn

Copy code

NameVirtualHost *:80
DocumentRoot project storage path ServerName benti.homelink.com.cn

After joining, save and close, then restart apache and browser to access directly with the custom domain name http://www.bkjia.com/PHPjc/632847.html
www.bkjia.com
true
http: //www.bkjia.com/PHPjc/632847.htmlTechArticleHow to install the PHP development environment? This may be a troublesome thing for PHP beginners. He needs to install php, mysql, apache or php mysql iis, the editor will introduce the first one below. ...
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!