欢迎访问 生活随笔!

生活随笔

当前位置: 首页 >

linux ubuntu php,linux ubuntu安装php运行环境

发布时间:2024/9/27 45 豆豆
生活随笔 收集整理的这篇文章主要介绍了 linux ubuntu php,linux ubuntu安装php运行环境 小编觉得挺不错的,现在分享给大家,帮大家做个参考.

1. 下载

下载apache。http://httpd.apache.org/。因为我想安装2.2.9,去这里下载:http://archive.apache.org/dist/httpd/

下载php。http://www.php.net/downloads.php

Mysql。http://dev.mysql.com/downloads/mysql/5.1.html。可能是ubuntu 10.04没有安装rpm,所以我下载了这个二进制分发版安装:mysql-5.1.58-linux-i686-glibc23.tar.gz

2. 安装

1. 安装apache

参考INSTALL文件

$ ./configure --prefix=/opt/apache

$ make

$ make install

$ /opt/apache/bin/apachectl start #运行

在浏览器打开:http://localhost/,显示 “It works”,安装成功。

2. 安装mysql

使用二进制分发版安装

shell> groupadd mysql

shell> useradd -r -g mysql mysql

shell> cd /opt

shell> tar zxvf /path/to/mysql-VERSION-OS.tar.gz

shell> ln -s full-path-to-mysql-VERSION-OS mysql

shell> cd mysql

shell> chown -R mysql .

shell> chgrp -R mysql .

shell> scripts/mysql_install_db --user=mysql

shell> chown -R root .

shell> chown -R mysql data

# Next command is optional

shell> cp support-files/my-medium.cnf /etc/my.cnf

shell> bin/mysqld_safe --user=mysql &

更改权限和密码:

shell> mysql -uroot

shell> SET PASSWORD FOR ''@'localhost' = PASSWORD('newpwd');

shell> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('newpwd');

3. 安装php

shell> ./configure --prefix=/opt/php --with-apxs2=/opt/apache/bin/apxs --with-mysql=/opt/mysql --with-config-file-path=/opt/php/etc --enable-soap

shell>  make

shell>  make install

3. 附

错误“configure: error: xml2-config not found. Please check your libxml2 installation.”。解决办法:从ftp://xmlsoft.org/libxml2/下载并安装libxml2

总结

以上是生活随笔为你收集整理的linux ubuntu php,linux ubuntu安装php运行环境的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。