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运行环境的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: c语言线性分类回归库 台湾,最全的线性回
- 下一篇: mysql 查看表格scott_mysq