linux ubuntu安装php运行环境

本文涉及的产品
云数据库 RDS MySQL Serverless,0.5-2RCU 50GB
简介: 1. 下载下载apache。http://httpd.apache.org/。因为我想安装2.2.9,去这里下载:http://archive.apache.org/dist/httpd/下载php。


1. 下载

  1. 下载apache。http://httpd.apache.org/。因为我想安装2.2.9,去这里下载:http://archive.apache.org/dist/httpd/
  2. 下载php。http://www.php.net/downloads.php
  3. 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. 附

  1. 错误“configure: error: xml2-config not found. Please check your libxml2 installation.”。解决办法:从ftp://xmlsoft.org/libxml2/下载并安装libxml2
相关实践学习
基于CentOS快速搭建LAMP环境
本教程介绍如何搭建LAMP环境,其中LAMP分别代表Linux、Apache、MySQL和PHP。
全面了解阿里云能为你做什么
阿里云在全球各地部署高效节能的绿色数据中心,利用清洁计算为万物互联的新世界提供源源不断的能源动力,目前开服的区域包括中国(华北、华东、华南、香港)、新加坡、美国(美东、美西)、欧洲、中东、澳大利亚、日本。目前阿里云的产品涵盖弹性计算、数据库、存储与CDN、分析与搜索、云通信、网络、管理与监控、应用服务、互联网中间件、移动服务、视频服务等。通过本课程,来了解阿里云能够为你的业务带来哪些帮助     相关的阿里云产品:云服务器ECS 云服务器 ECS(Elastic Compute Service)是一种弹性可伸缩的计算服务,助您降低 IT 成本,提升运维效率,使您更专注于核心业务创新。产品详情: https://www.aliyun.com/product/ecs
相关文章
|
22天前
|
Ubuntu NoSQL 关系型数据库
Ubuntu系统下安装常用软件
Ubuntu系统下安装常用软件
44 0
Ubuntu系统下安装常用软件
|
1月前
|
Ubuntu Java 测试技术
【Linux】一站式教会:Ubuntu(无UI界面)使用apache-jmeter进行压测
【Linux】一站式教会:Ubuntu(无UI界面)使用apache-jmeter进行压测
|
1月前
|
Ubuntu Linux C语言
Ubuntu下安装vscode,并解决终端打不开vscode的问题
Ubuntu下安装vscode,并解决终端打不开vscode的问题
135 0
|
1月前
|
Ubuntu Docker 容器
如何在Ubuntu上安装Docker?
【2月更文挑战第10天】
241 0
|
23天前
|
Ubuntu 关系型数据库 MySQL
Ubuntu 中apt 安装MySQL数据库
Ubuntu 中apt 安装MySQL数据库
66 0
|
2天前
|
Ubuntu 数据安全/隐私保护
在UBUNTU虚拟机上安装R软件包
在UBUNTU虚拟机上安装R软件包
|
3天前
|
存储 编解码 Ubuntu
0-零基础安装ubuntu(超详细安装步骤)
0-零基础安装ubuntu(超详细安装步骤)
|
3天前
|
Ubuntu Linux 定位技术
手把手教你优雅的安装虚拟机 Ubuntu —— 图文并茂
手把手教你优雅的安装虚拟机 Ubuntu —— 图文并茂
|
9天前
|
NoSQL Linux PHP
php添加redis扩展 linux和windos图文详解 l
php添加redis扩展 linux和windos图文详解 l
3 0
|
16天前
|
人工智能 Ubuntu 机器人
【ubuntu】 Linux(ubuntu)创建python的虚拟环境
【ubuntu】 Linux(ubuntu)创建python的虚拟环境