[Php5.4] Virtual Machine virtualbox + Ubuntu Server Configuration

Source: Internet
Author: User

Php5.4 has been released, and several functions are quite attractive. As an updated version, it will be supported later.ProgramThere will certainly be more and more environments. to make good use of these new features, you must first learn. you must configure a php5.4 environment first, because development must be performed in section 5.3 (for fear of incompatibility with the server environment ), manual PHP compilation for Mac OS X systems has also been a problem.

To try php5.4, I chose the Virtual Machine solution of virtualbox + Ubuntu server.

Virtualbox is an open-source, free, and powerful Virtual Machine Software. Ubuntu server is much lighter than Ubuntu Desktop. Of course, choosing desktop is also good for kids shoes that like mouse clicks.

I will not talk about installing virtualbox and Ubuntu server. Please refer to the relevant documentation. If you choose the same solution as me, leave a message below and try to help you.

When using a vro, you are advised to use bridage to connect to the virtual machine. It is very easy for the Virtual Machine to access each other by assigning IP addresses in the same network segment as the host.
A virtual machine uses the Shared Folders function to share a directory of the host to the virtual machine.

After the installation is complete, the virtual machine is installed, the additional tool is loaded, and then loaded in the virtual machine.

Sudo Mount-T Auto/dev/CDROM/mnt/CDROM
CD/mnt/CDROM/
Sudo./vboxlinuxadditions. Run

Run the preceding command to install the additional tool.

You may need to restart the VM.

Cd ~
Mkdir htdocs
Sudo Mount-T vboxsf main_shared ~ /Htdocs

Run the preceding command to mount the directory shared by the host to the virtual machine. Here, I have created a directory named htdocs in the main directory.
Main_shared is the name set in vbox when the host is shared to the virtual machine.

Install the compilation tool and some components before compilation.

Sudo apt-Get install Ubuntu-Dev-Tools
Sudo apt-Get install libxml2-dev

Download php5.4 from a VMSource code;

Cd ~
Wget [url] http://cn2.php.net/distributions/php-5.4.0.tar.bz2#/url]
Tar-XF php-5.4.0.tar.bz2
CD php-5.4.0/
./Configure
Sudo make & sudo make install

If any component is missing or cannot be compiled, there will be prompts about missing or inappropriate components. Solve them one by one.

Run commands

Php-V

If similar information appears, php5.4 is successfully installed.

PHP 5.4.0 (CLI) (built: Mar 11 2012 16:50:41)
Copyright (c) 1997-2012 the PHP Group
Zend engine v2.4.0, copyright (c) 1998-2012 Zend Technologies

Php5.4 has a built-in web server for debugging. if the demand is not too strong, it can replace Apache and other big guys.

Cd ~ /Htdocs
Sudo PHP-s 192.168.1.109: 80

Run the preceding command to start the Web server. The main directory of the server is the current directory, which is the htdocs directory we just created in the main directory.

We can share this information to the Virtual Machine directory on the host.Code.
Then, access 192.168.1.109: 80 in the browser of the host to view the code running result.

If every command runs in a virtual machine, we can install remote access.
Then access using SSH or putty. It seems that the virtualbox under Win can be run directly in the background. This is too comfortable, and the virtualbox under Mac OS X cannot be accessed in the background, which is slightly uncomfortable.

After writing, you will find that I writeArticleThere is really no talent, and the writing is messy. I hope it will be helpful. Let's discuss the new features of php5.4.
After work in the evening (tragic, Saturday, Sunday, and two days later, I have to continue working on Monday tomorrow), I will study the new features of php5.4. The results will be reported to you.

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.