Linux 安装 php
Linux 版本 : Redhat6.2 php版本 : php-5.4.1 之前写过: Linux Apache 安装 Linux 安装 php-5.4.1 1. 下 载 php-5.4.1.tar.gz 2. 解压 [root@test31~] tar -zxvf php-5.4.1.tar.gz 3. 进入安装文件目录 [root@test31~] cd php-5.4.1 4. 执行 [root@test31
Linux 版本: Redhat6.2
php版本
之前写过: Linux Apache 安装
Linux 安装 php-5.4.1
1. 下载 php-5.4.1.tar.gz
2. 解压
[root@test31~] tar -zxvf php-5.4.1.tar.gz
3. 进入安装文件目录
[root@test31~] cd php-5.4.1
4. 执行
[root@test31 php-5.4.1]# ./configure --prefix=/usr/local/php5--with-apxs2=/usr/local/web/apache/bin/apxs--with-mysql
注意:绿色标记为你 apache的安装目录
出现问题:
"configure: error: xml2-config not found.Please check your libxml2 installation."
检查是否安装了libxm包
[root@test31 php-5.4.1]# rpm -qa |grep
libxml2-2.6.26-2.1.12
libxml2-python-2.6.26-2.1.12
重新安装libxml2和libxml2-devel包
yum install libxml2
yum install libxml2-devel -y
安装完之后查找xml2-config文件是否存在
[root@test31 php-5.4.1]#
/usr/bin/xml2-config
如果存在的话重新安装php
[root@test31 php-5.4.1]# ./configure --prefix=/usr/local/php5--with-apxs2=/usr/local/web/apache/bin/apxs--with-mysql
执行如果报错:
需要指定mysql的安装路径
[root@test31 php-5.4.1]# ./configure --prefix=/usr/local/php5--with-apxs2=/usr/local/web/apache/bin/apxs
安装成功的标志是:
出现
+--------------------------------------------------------------------+ Thank you for using PHP. |
[root@test31 php-5.4.1]# make
[root@test31 php-5.4.1]# make install
6. 配置 php.ini
<span>[root@test31 php-5.4.1]# cp php.ini-development /usr/local/lib/php.ini</span>
7. 编辑 httpd.conf 文件以调用 PHP 模块。LoadModule 表达式右边的路径必须指向 系统中的 PHP。以上的make install 命令可能已经完成了这些,但务必要检查。
[root@test31 php-5.4.1]# vi/usr/local/web/apache/conf/httpd.conf
<span>LoadModule php5_module modules/libphp5.so</span>
再加入一行让apache正确处理apache文件
AddType application/x-httpd-php.php
再找到 DirectoryIndex关键字:添加 index.php
开启.httaccess功能
AllowOverrideAll
保存对httpd.conf的修改。
8. 查看是否安装成功
在apache的htdocs目录下建立文件phpinfo.php 输入代码
phpinfo();
?>
保存,并启动apache。
[root@test31 bin]#./apachectl start
9.打开网址:
出现php相关的信息,说明php-5.4.1 安装成功了!
参考 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



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,

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.

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.

Using python in Linux terminal...

Multithreading in the language can greatly improve program efficiency. There are four main ways to implement multithreading in C language: Create independent processes: Create multiple independently running processes, each process has its own memory space. Pseudo-multithreading: Create multiple execution streams in a process that share the same memory space and execute alternately. Multi-threaded library: Use multi-threaded libraries such as pthreads to create and manage threads, providing rich thread operation functions. Coroutine: A lightweight multi-threaded implementation that divides tasks into small subtasks and executes them in turn.

Regarding the problem of removing the Python interpreter that comes with Linux systems, many Linux distributions will preinstall the Python interpreter when installed, and it does not use the package manager...

In PHP8, match expressions are a new control structure that returns different results based on the value of the expression. 1) It is similar to a switch statement, but returns a value instead of an execution statement block. 2) The match expression is strictly compared (===), which improves security. 3) It avoids possible break omissions in switch statements and enhances the simplicity and readability of the code.

To open a web.xml file, you can use the following methods: Use a text editor (such as Notepad or TextEdit) to edit commands using an integrated development environment (such as Eclipse or NetBeans) (Windows: notepad web.xml; Mac/Linux: open -a TextEdit web.xml)
