Linux上安装PHP的问题
在虚拟机上安装PHP(测试成功通过,问题已经解决) (1)首先把php-5.2.17.tar.gz挂载到操作系统上 mount /mnt/cdrom(我的做法是然后复制到/home/soft目录下,这里专门放置我的软件包,读者可以不需要这样做) (2)然后解压 tar -zxvfphp-5.2.17.tar.gz ,
在虚拟机上安装PHP(测试成功通过,问题已经解决)
(1)首先把php-5.2.17.tar.gz挂载到操作系统上 mount /mnt/cdrom(我的做法是然后复制到/home/soft目录下,这里专门放置我的软件包,读者可以不需要这样做)
(2)然后解压 tar -zxvf php-5.2.17.tar.gz ,当前目录出现php-5.2.17文件,进入php-5.2.17文件中cd php-5.2.17
(3)然后准备安装./configure --prefix=/usr/local/php
--with-apxs2=/usr/local/apache/bin/apxs
--with-mysql=/usr/local/mysql
(4)当执行第三步的代码的时候出现configure: error: libxml2 version 2.6.11 or greater required.这样的问题,这样就不能make以及make install操作了。首先分析问题,看到刚才报错的提示,发现时操作系统自带的libxml2的版本过低。这个时候需要在本操作系统上查看是否安装过libxml.
(5)rpm -qa |grep libxml,发现本操作系统确实安装了libxml的软件,但是版本过低,此时我在www.xmlsoft.org网站中下载更高的版本程序包(libxml2-2.7.2。tar.gz)准备进行安装
(6)首先是卸载过低版本的libxml2。rpm -e libxml --nodeps(强制删除)
(7)卸载完之后接下来安装新版本的libxml2-2.7.2.步骤:挂载-》解压,解压后进入到libxml2-2.7.2目录中然后执行./configure --prefix=/usr/local/libxml命令准备安装-》make->make install 这样就安装完心版本的libxml2-2.7.2
(8)安装完之后返回第三步重新开始安装PHP
./configure --prefix=/usr/local/php
--with-apxs2=/usr/local/apache/bin/apxs
--with-mysql=/usr/local/mysql
(9)这时候还是出现configure: error: libxml2 version 2.6.11 or greater required.这样的问题,经过分析后发现在PHP的安装过程中没有指定libxml2所在的路径,所以附带参数-
./configure --prefix=/usr/local/php
--with-apxs2=/usr/local/apache/bin/apxs
--with-mysql=/usr/local/mysql
--with-libxml-dir=/usr/local/libxml。
(10)这时候执行成功,然后执行make,最后执行make install
(11)当我第二天启动系统执行startx进入操作界面的时候又出现新的一个问题
error while loading shared libraries: libxml2.so.2:cannot open shared object file: No such file or directory这样的问题。首先经过分析之后找到原因,是因为昨天我安装了libxml2的时候我指定它一个新的安装目录,系统找不到libxml2.so.2
(12)我进入/usr/local/libxml/lib中确实是发有libxml2.so.2。然后我经过分析之后就在/etc/ld.so.conf中加入/usr/local/libxml/lib这一行,保存之后,再运行:/sbin/ldconfig –v更新一下配置即可。
(13)经过以上问题的解决,总体把PHP安装完成,接下来就需要把php,mysql.apache。配置好并运行起来,这样LAMP(Linux+Apache+MySQL+PHP)环境搭建好了。

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

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

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

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

Hot Topics

PHP 8.4 brings several new features, security improvements, and performance improvements with healthy amounts of feature deprecations and removals. This guide explains how to install PHP 8.4 or upgrade to PHP 8.4 on Ubuntu, Debian, or their derivati

DeepSeek is a powerful intelligent search and analysis tool that provides two access methods: web version and official website. The web version is convenient and efficient, and can be used without installation; the official website provides comprehensive product information, download resources and support services. Whether individuals or corporate users, they can easily obtain and analyze massive data through DeepSeek to improve work efficiency, assist decision-making and promote innovation.

There are many ways to install DeepSeek, including: compile from source (for experienced developers) using precompiled packages (for Windows users) using Docker containers (for most convenient, no need to worry about compatibility) No matter which method you choose, Please read the official documents carefully and prepare them fully to avoid unnecessary trouble.

Visual Studio Code, also known as VS Code, is a free source code editor — or integrated development environment (IDE) — available for all major operating systems. With a large collection of extensions for many programming languages, VS Code can be c

This tutorial demonstrates how to efficiently process XML documents using PHP. XML (eXtensible Markup Language) is a versatile text-based markup language designed for both human readability and machine parsing. It's commonly used for data storage an

Top 10 virtual currency trading platforms in the 2025 cryptocurrency circle: 1. OKX, known for its high liquidity, low fees and abundant products; 2. Binance, one of the world's largest exchanges, with a huge user base; 3. Gate.io, a veteran exchange, safe and stable; 4. Kraken, focusing on professional traders, safe and compliant; 5. Huobi Global, a world-renowned, strong technical strength; 6. Coinbase, a leading exchange in the United States, easy to use compliance; 7. KuCoin, rich trading pairs, low fees.

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

BITGet is a cryptocurrency exchange that provides a variety of trading services including spot trading, contract trading and derivatives. Founded in 2018, the exchange is headquartered in Singapore and is committed to providing users with a safe and reliable trading platform. BITGet offers a variety of trading pairs, including BTC/USDT, ETH/USDT and XRP/USDT. Additionally, the exchange has a reputation for security and liquidity and offers a variety of features such as premium order types, leveraged trading and 24/7 customer support.
