Build the php website runtime environment under Ubuntu10.04

Source: Internet
Author: User
Tags php website
Prerequisites for setting up a php website running environment under Ubuntu10.04: to enable the root permission sudopassword [enter the root password here] 1. Step 1 install Ubuntu10.042, update the source sudoapt-getupdate3, install lighttpdsudoapt-getinstalllighttpd, and check whether lighttpd is started successfully, open URL in the browser: & n

Build a php website runtime environment in Ubuntu 10.04

Prerequisites:

To enable the root permission

Sudo password [enter the root password here]

1. Step 1 install Ubuntu 10.04

2. Update Source

Sudo apt-get update

3. Install lighttpd

Sudo apt-get install lighttpd

After installation, check whether lighttpd is successfully started. Open the URL: http: // localhost/in the browser/

If it's works is displayed successfully

If not, end the lighttpd process.

Then enter

Sudo lighttpd-f/etc/lighttpd. conf

4. install PHP

Sudo apt-get install php5

Continue after completion

Sudo apt-get install php5-cli

Continue after completion

Sudo apt-get install php5-cgi

Continue after completion

Sudo apt-get install php5-mysql

Let lighttpd support cgi Mode

# Lighttpd-enable-mod fastcgi

Restart Lighttpd

#/Etc/init. d/lighttpd restart

5. Change the owner of the/var/www folder to the current user (some may not need this step)

Sodu chown-R xu2006: xu2006/var/www

In this way, the owner of the www folder is xu2006, so that the file can be written.

6. Open the www folder (var/www)

Right-click -- Create Document --- empty file

File Name: test. php

Write the following content and save it.

<? Php

// This file will test to see if php

// Is enabled and functiona;

Phpinfo ();

?>

Then open http: // localhost/test. php

You will see the PHP information on the webpage

7. Install mysql

Sudo apt-get install mysql-server-5.1 mysql-client-5.1

During the installation process, you will be prompted to enter the management password

8. Install phpmyadmin to manage mysql

Sudo apt-get install phpmyadmin

When it prompts you to select the web server, do not select anything, and then install it OK.

Move phpmyadmin to/var/www and we can use phpmyadmin to manage mysql.

# Sudo mv/usr/share/phpadmin/var/www

Open http: // localhost/phpmyadmin to check whether mysql can be managed.

At this point, the php website runtime environment is ready! Now you can download some php-type website programs for installation and testing to check your labor results.

Php programs include discuz wordpress and so on.

Root folder permission

Sudo chmod-R 0777/home/1.txt

Sudo chmod-R [permission] [directory or file]

Sudo chwon-R root: root/var/www

Sudo chown-R [User name: User Group] [directory or file]

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.