在linux(ubuntu)环境下, 编译安装PHP的步骤.
注: 不同操作系统下, 安装路径不同,请注意!
1. 下载php源码
$cd /usr/local/src
$wget http://cn.php.net/get/php-5.3.6.tar.bz2/from/this/mirror
2. 解压缩并安装
$tar jxvf php-5.3.6.tar.bz2
$cd php-5.3.6/
$./configure --prefix=/usr/local/php5 --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/home/service/mysql --with-zlib
$make
$make install
3. 修改apache配置,使得apache可以识别".php"文件
$cd /etc/apach2
$vi apache2.conf
在文件末尾增加如下内容:
1 LoadModule php5_module modules/libphp5.so 2 <IfModule !mod_php5.c> 3 LoadModule php5_module lib/modules/libphp5.so 4 </IfModule> 5 6 <IfModule mod_php5.c> 7 AddType application/x-httpd-php .php 8 AddType application/x-httpd-php .php5 9 AddType application/x-httpd-php-source .phps 10 AddType application/x-httpd-php-source .php5s 11 DirectoryIndex index.php 12 DirectoryIndex index.php5 13 </IfModule>
保存退出.
$/usr/local/apache2/bin/apachectl restart
重启apche,然后用phpinfo()函数就能看到安装的php模块了.
附:
linux下编译php中configure参数具体含义
http://apps.hi.baidu.com/share/detail/34997687
参考文档:
http://blog.csdn.net/lanyd/article/details/6037927
http://hi.baidu.com/comeon010/blog/item/983b29cbab80f912bf09e6a1.html
http://hi.baidu.com/travel981cn/blog/item/2514bf34069031b0d0a2d30e.html
http://www.phpbegin.com/html/96/n-4296.html
http://www.cnblogs.com/qingfeng2010/archive/2011/01/07/1930333.html

Long URLs, often cluttered with keywords and tracking parameters, can deter visitors. A URL shortening script offers a solution, creating concise links ideal for social media and other platforms. These scripts are valuable for individual websites a

Laravel simplifies handling temporary session data using its intuitive flash methods. This is perfect for displaying brief messages, alerts, or notifications within your application. Data persists only for the subsequent request by default: $request-

This is the second and final part of the series on building a React application with a Laravel back-end. In the first part of the series, we created a RESTful API using Laravel for a basic product-listing application. In this tutorial, we will be dev

Laravel provides concise HTTP response simulation syntax, simplifying HTTP interaction testing. This approach significantly reduces code redundancy while making your test simulation more intuitive. The basic implementation provides a variety of response type shortcuts: use Illuminate\Support\Facades\Http; Http::fake([ 'google.com' => 'Hello World', 'github.com' => ['foo' => 'bar'], 'forge.laravel.com' =>

The PHP Client URL (cURL) extension is a powerful tool for developers, enabling seamless interaction with remote servers and REST APIs. By leveraging libcurl, a well-respected multi-protocol file transfer library, PHP cURL facilitates efficient execution of various network protocols, including HTTP, HTTPS, and FTP. This extension offers granular control over HTTP requests, supports multiple concurrent operations, and provides built-in security features.

Do you want to provide real-time, instant solutions to your customers' most pressing problems? Live chat lets you have real-time conversations with customers and resolve their problems instantly. It allows you to provide faster service to your custom

The 2025 PHP Landscape Survey investigates current PHP development trends. It explores framework usage, deployment methods, and challenges, aiming to provide insights for developers and businesses. The survey anticipates growth in modern PHP versio

In this article, we're going to explore the notification system in the Laravel web framework. The notification system in Laravel allows you to send notifications to users over different channels. Today, we'll discuss how you can send notifications ov


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

SublimeText3 Linux new version
SublimeText3 Linux latest version

SublimeText3 Chinese version
Chinese version, very easy to use

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Mac version
God-level code editing software (SublimeText3)
