Table of Contents
Configuration of PHP development environment (installing Apache and PHP on Linux platform)
Home Backend Development PHP Tutorial Configuration of PHP development environment (installing Apache and PHP on Linux platform)_PHP tutorial

Configuration of PHP development environment (installing Apache and PHP on Linux platform)_PHP tutorial

Jul 13, 2016 am 09:51 AM
platform environment

Configuration of PHP development environment (installing Apache and PHP on Linux platform)

Configuration of PHP development environment (install Apache and php on Linux platform):

Download Apache (httpd-2.4.12.tar.gz), download PHP (php-5.6.9.tar.gz), download libxml2 (libxml2-2.7.8.tar.gz) related to PHP installation, Download three files related to Apache installation: apr(apr-1.5.2.tar.gz), apr-util(apr-util-1.5.4.tar.gz), pcre (pcre-8.10.zip)

(1) Install Apache: apr, apr-util and pcre must be installed before installing apache, otherwise an error will occur:

Install apr:

Gunzip apr-1.5.2.tar.gz

Tar xvf apr-1.5.2.tar

Enter the apr-1.5.2 directory and execute:

./configure --prefix=/usr/local/apr

Make && make install

Install apr-util:

After decompressing, enter the apr-util directory and execute:

./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr/bin/apr-1-config

Make && make install

Install pcre: Before installation, gcc must be installed first, otherwise the pcre file cannot be compiled

Install gcc: yum -y install gcc gcc-c

Then install pcre:

After decompressing, enter the pcre directory, and then execute:

./configure --prefix=/usr/local/pcre

Make && make install

After installing these files, you can install apache and unzip httpd-2.4.12.tar.gz:

Gunzip httpd-2.4.12.tar.gz

Tar xvf httpd-2.4.12.tar

Enter the decompression directory: cd httpd-2.4.12, then execute:

./configure --prefix=/usr/local/apache --enable-so --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util

--with-pcre=/usr/local/pcre

Make && make install

(2) Install PHP:

Install libxml2 before installing php:

After decompression, enter the directory: libxml2-2.7.8, and then execute:

./configure --prefix=/usr/local/libxml2

Make && make install

Install php: After unzipping, enter the directory php-5.6.9, and then execute:

./configure --prefix=/usr/local/php --with-libxml-dir=/usr/local/libxml2 --with-apxs2=/usr/local/apache/bin/apxs

Make && make install

After installing php, copy php.ini-development in the unzipped php-5.6.9 directory to the following directory:

cp php.ini-development /usr/local/php/lib/php.ini

(3) Configure httpd-conf in Apache's conf folder and add the following content (if it does not exist):

Add LoadModule php5_module module/libphp5.so at LoadModule

Add AddType application/x-httpd-php .php at AddTypeapplication

(4) Start or restart Apache:

/usr/local/apache/bin/apachectl restart (or start)

(5) Test whether Apache and PHP are installed correctly:

Go to the htdocs directory in Apache,

[root@Masterpc htdocs]# vim hello.php

echo "Hello world!";

phpinfo();

?>

Input in the browser: http://172.16.2.42/hello.php (the IP address of my Linux host is 172.16.2.42, through remote access). If the access is successful, it will be displayed as follows:

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1011358.htmlTechArticleConfiguration of PHP development environment (installation of Apache and PHP on Linux platform) Configuration of PHP development environment (installation on Linux platform Apache and php): Download Apache (httpd-2.4.12.tar.gz), download PHP (php-5.6.9.tar....
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)

Unable to boot into Windows recovery environment Unable to boot into Windows recovery environment Feb 19, 2024 pm 11:12 PM

Windows Recovery Environment (WinRE) is an environment used to repair Windows operating system errors. After entering WinRE, you can perform system restore, factory reset, uninstall updates, etc. If you are unable to boot into WinRE, this article will guide you through fixes to resolve the issue. Unable to boot into the Windows Recovery Environment If you cannot boot into the Windows Recovery Environment, use the fixes provided below: Check the status of the Windows Recovery Environment Use other methods to enter the Windows Recovery Environment Did you accidentally delete the Windows Recovery Partition? Perform an in-place upgrade or clean installation of Windows below, we have explained all these fixes in detail. 1] Check Wi

What shopping platforms support WeChat payment? What shopping platforms support WeChat payment? Nov 02, 2022 pm 02:44 PM

Shopping platforms that support WeChat payment include: 1. JD.com, a comprehensive online retailer in China; 2. Vipshop, an Internet company that sells branded discounted goods online; 3. Pinduoduo, a leader in new social e-commerce. A shopping platform that better understands consumers; 4. Jingxi, a lifestyle shopping mall under JD.com; 5. Mogujie, an e-commerce website; 6. Jumei Youpin, a fashion shopping website mainly selling cosmetics; 7. , Weidian is a cloud promotion e-commerce platform; 8. Kaola Overseas Shopping is a membership e-commerce platform focusing on cross-border overseas shopping business.

What are the differences between Python and Anaconda? What are the differences between Python and Anaconda? Sep 06, 2023 pm 08:37 PM

In this article, we will learn about the differences between Python and Anaconda. What is Python? Python is an open source language that places great emphasis on making the code easy to read and understand by indenting lines and providing whitespace. Python's flexibility and ease of use make it ideal for a variety of applications, including but not limited to scientific computing, artificial intelligence, and data science, as well as creating and developing online applications. When Python is tested, it is immediately translated into machine language because it is an interpreted language. Some languages, such as C++, require compilation to be understood. Proficiency in Python is an important advantage because it is very easy to understand, develop, execute and read. This makes Python

What are the empty account detection platforms? Empty number detection tool What are the empty account detection platforms? Empty number detection tool Mar 07, 2024 pm 01:46 PM

With the advancement of communication technology, telephone contact has become more and more common in our daily lives. However, sometimes we may try to call a number only to find that the number is no longer reachable. In order to save time and energy, many people start looking for empty number verification services to confirm the validity of the number. This service can help users quickly check whether a number is valid and avoid unnecessary trouble. 1. What are the empty account detection platforms? Users can check the status of the number, including whether it is empty, by dialing the corresponding inquiry number or visiting the official website through the official inquiry service provided by the operator. This service is provided by many operators to facilitate users to quickly understand the usage of the number. Online empty number detection platforms are now emerging in an endless stream on the market. These platforms provide quick and convenient

Where can I buy Optimism coins? Which platform is Optimism Coin traded on? Where can I buy Optimism coins? Which platform is Optimism Coin traded on? Feb 28, 2024 pm 04:40 PM

Where can I buy Optimism coins? Optimism Coin can be purchased on a number of cryptocurrency exchanges, including: Binance Huobi OKX Matcha Gate.io Kraken Bittrex Poloniex Coinbase Pro Gemini You will need to register an account with these exchanges and complete identity verification before you can purchase Optimism Coin. The steps to purchase Optimism coins are as follows: Choose a safe and reliable exchange. Register an account and complete identity verification. Fund your account. On the trading interface of the trading platform, find the trading pair of Optimism currency, such as OP/USDT. Enter the amount of Optimism coins you want to purchase and click

What platform is tme? What platform is tme? Dec 12, 2022 pm 05:15 PM

tme, the full name of "TME Music Cloud Atlas", is a digital distribution platform under Tencent Music Entertainment Group. It is a professional data platform officially announced by Tencent Music Entertainment Group (TME) for cooperative music labels to provide data BI services to industry partners. The TME platform can not only help music labels gain insight into the online real-time data performance of songs and albums under copyright ownership, but also help content producers quickly grasp trends in the music market and listener preferences.

Where can I buy EC coins? On which platform are EC coins traded? Where can I buy EC coins? On which platform are EC coins traded? Feb 27, 2024 pm 04:49 PM

Where can I buy EC coins? On which platform are EC coins traded? Text: EC coin (Ethereum Classic, abbreviation: ETC) is an open source, decentralized blockchain platform and the first hard fork currency of Ethereum. EC Coin has a similar technical foundation to Ethereum, but there are also some key differences. For example, EC Coin has a shorter block time and does not use the Proof of Stake (PoS) consensus mechanism. EC coins can be purchased on many cryptocurrency trading platforms, including: Centralized exchanges: Binance, Huobi, OKX, Matcha, Gate.io, Kraken, Bittrex, Poloniex, etc. Decentralized exchanges: PancakeSwap, Uniswap, Su

What platform is zz? What platform is zz? Oct 31, 2022 pm 04:43 PM

zz is the abbreviation of "Zhuanzhuan". It is a second-hand idle trading platform. It is committed to building a professional second-hand trading platform to provide users with more secure, professional and assured products and services; its business covers mobile phones, 3C digital, books , clothing, shoes and hats, maternal and infant products, furniture and home appliances, and more than 30 trading categories.

See all articles