Home Backend Development PHP Tutorial How to install PHP development environment? PHP environment installation configuration_PHP tutorial

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

Jul 13, 2016 am 10:47 AM
php beginner Woolen cloth Install develop how environment this Configuration

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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1664
14
PHP Tutorial
1266
29
C# Tutorial
1239
24
Explain JSON Web Tokens (JWT) and their use case in PHP APIs. Explain JSON Web Tokens (JWT) and their use case in PHP APIs. Apr 05, 2025 am 12:04 AM

JWT is an open standard based on JSON, used to securely transmit information between parties, mainly for identity authentication and information exchange. 1. JWT consists of three parts: Header, Payload and Signature. 2. The working principle of JWT includes three steps: generating JWT, verifying JWT and parsing Payload. 3. When using JWT for authentication in PHP, JWT can be generated and verified, and user role and permission information can be included in advanced usage. 4. Common errors include signature verification failure, token expiration, and payload oversized. Debugging skills include using debugging tools and logging. 5. Performance optimization and best practices include using appropriate signature algorithms, setting validity periods reasonably,

Explain late static binding in PHP (static::). Explain late static binding in PHP (static::). Apr 03, 2025 am 12:04 AM

Static binding (static::) implements late static binding (LSB) in PHP, allowing calling classes to be referenced in static contexts rather than defining classes. 1) The parsing process is performed at runtime, 2) Look up the call class in the inheritance relationship, 3) It may bring performance overhead.

PHP Program to Count Vowels in a String PHP Program to Count Vowels in a String Feb 07, 2025 pm 12:12 PM

A string is a sequence of characters, including letters, numbers, and symbols. This tutorial will learn how to calculate the number of vowels in a given string in PHP using different methods. The vowels in English are a, e, i, o, u, and they can be uppercase or lowercase. What is a vowel? Vowels are alphabetic characters that represent a specific pronunciation. There are five vowels in English, including uppercase and lowercase: a, e, i, o, u Example 1 Input: String = "Tutorialspoint" Output: 6 explain The vowels in the string "Tutorialspoint" are u, o, i, a, o, i. There are 6 yuan in total

Is HTML easy to learn for beginners? Is HTML easy to learn for beginners? Apr 07, 2025 am 12:11 AM

HTML is suitable for beginners because it is simple and easy to learn and can quickly see results. 1) The learning curve of HTML is smooth and easy to get started. 2) Just master the basic tags to start creating web pages. 3) High flexibility and can be used in combination with CSS and JavaScript. 4) Rich learning resources and modern tools support the learning process.

What are PHP magic methods (__construct, __destruct, __call, __get, __set, etc.) and provide use cases? What are PHP magic methods (__construct, __destruct, __call, __get, __set, etc.) and provide use cases? Apr 03, 2025 am 12:03 AM

What are the magic methods of PHP? PHP's magic methods include: 1.\_\_construct, used to initialize objects; 2.\_\_destruct, used to clean up resources; 3.\_\_call, handle non-existent method calls; 4.\_\_get, implement dynamic attribute access; 5.\_\_set, implement dynamic attribute settings. These methods are automatically called in certain situations, improving code flexibility and efficiency.

PHP and Python: Comparing Two Popular Programming Languages PHP and Python: Comparing Two Popular Programming Languages Apr 14, 2025 am 12:13 AM

PHP and Python each have their own advantages, and choose according to project requirements. 1.PHP is suitable for web development, especially for rapid development and maintenance of websites. 2. Python is suitable for data science, machine learning and artificial intelligence, with concise syntax and suitable for beginners.

PHP in Action: Real-World Examples and Applications PHP in Action: Real-World Examples and Applications Apr 14, 2025 am 12:19 AM

PHP is widely used in e-commerce, content management systems and API development. 1) E-commerce: used for shopping cart function and payment processing. 2) Content management system: used for dynamic content generation and user management. 3) API development: used for RESTful API development and API security. Through performance optimization and best practices, the efficiency and maintainability of PHP applications are improved.

PHP: A Key Language for Web Development PHP: A Key Language for Web Development Apr 13, 2025 am 12:08 AM

PHP is a scripting language widely used on the server side, especially suitable for web development. 1.PHP can embed HTML, process HTTP requests and responses, and supports a variety of databases. 2.PHP is used to generate dynamic web content, process form data, access databases, etc., with strong community support and open source resources. 3. PHP is an interpreted language, and the execution process includes lexical analysis, grammatical analysis, compilation and execution. 4.PHP can be combined with MySQL for advanced applications such as user registration systems. 5. When debugging PHP, you can use functions such as error_reporting() and var_dump(). 6. Optimize PHP code to use caching mechanisms, optimize database queries and use built-in functions. 7

See all articles