Home Backend Development PHP Tutorial ubuntu 10.04上搭建php网站运行环境

ubuntu 10.04上搭建php网站运行环境

Jun 13, 2016 pm 01:21 PM
install php phpmyadmin sudo

ubuntu 10.04下搭建php网站运行环境

ubuntu 10.04下搭建php网站运行环境
前提:
要打开root权限
sudo password [这里填写root密码]

1、第一步安装ubuntu10.04
2、更新源
sudo apt-get update
3、安装lighttpd
sudo apt-get install lighttpd
安装好之后检查lighttpd是否成功启动,在浏览器里打开URL:    http://localhost/
如果显示为 it's works 表面已经成功了
如果不行的话,结束掉lighttpd程序的进程
然后再输入
sudo lighttpd -f /etc/lighttpd/lighttpd.conf
4、安装PHP
sudo apt-get install php5
完成后继续
sudo apt-get install php5-cli
完成后继续
sudo apt-get install php5-cgi
完成后继续
sudo apt-get install php5-mysql
让lighttpd 支持cgi模式
# lighttpd-enable-mod fastcgi
重起Lighttpd

# /etc/init.d/lighttpd restart

5、将/var/www文件夹的owner改变成当前用户(有的可能不需要这步)
sodu chown -R xu2006:xu2006  /var/www
这样www文件夹的拥有者即为xu2006,这样就可以写入文件了
6、打开www文件夹(var/www)
右键--Create Document ---empty file
文件名为:test.php
在里面写入下面内容并保存
< ?php
// this file will test to see if php
// is enabled and functiona;
phpinfo();
?>
然后打开 http://localhost/test.php
你会看到网页中的PHP信息
7、安装mysql
sudo apt-get install mysql-server-5.1 mysql-client-5.1
在这个安装过程中会提示你输入管理密码
8、安装phpmyadmin 用来管理mysql
sudo apt-get install phpmyadmin
当它提示你选择那种web server时,什么都不要选,然后OK安装   就行

把phpmyadmin移动到/var/www我们就能用phpmyadmin管理mysql了
# sudo mv /usr/share/phpadmin /var/www
打开http://localhost/phpmyadmin 看看是不是能管理mysql了
到此,php网站运行环境就搭载好了!你现在就可以下载一些php类型的网站程序安装测试看看,
检验一下自己的劳动成果
php程序有:discuz wordpress 等等。
根本文件夹权限
sudo chmod -R 0777 /home/1.txt
sudo chmod -R 【权限】 【目录或文件】
sudo chwon -R root:root /var/www
sudo chown -R [用户名:用户组]  【目录或文件】
Copy after login

?

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

CakePHP Project Configuration CakePHP Project Configuration Sep 10, 2024 pm 05:25 PM

In this chapter, we will understand the Environment Variables, General Configuration, Database Configuration and Email Configuration in CakePHP.

PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian Dec 24, 2024 pm 04:42 PM

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

CakePHP Date and Time CakePHP Date and Time Sep 10, 2024 pm 05:27 PM

To work with date and time in cakephp4, we are going to make use of the available FrozenTime class.

CakePHP File upload CakePHP File upload Sep 10, 2024 pm 05:27 PM

To work on file upload we are going to use the form helper. Here, is an example for file upload.

CakePHP Routing CakePHP Routing Sep 10, 2024 pm 05:25 PM

In this chapter, we are going to learn the following topics related to routing ?

Discuss CakePHP Discuss CakePHP Sep 10, 2024 pm 05:28 PM

CakePHP is an open-source framework for PHP. It is intended to make developing, deploying and maintaining applications much easier. CakePHP is based on a MVC-like architecture that is both powerful and easy to grasp. Models, Views, and Controllers gu

How To Set Up Visual Studio Code (VS Code) for PHP Development How To Set Up Visual Studio Code (VS Code) for PHP Development Dec 20, 2024 am 11:31 AM

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

CakePHP Creating Validators CakePHP Creating Validators Sep 10, 2024 pm 05:26 PM

Validator can be created by adding the following two lines in the controller.

See all articles