Build laravel--php Upgrade--apache upgrade

Source: Internet
Author: User
Tags mcrypt php development environment php source code

Write at the top of the page:

I've been busy lately and don't have time for this stuff. Today, more than half an hour to write this blog, for themselves and others, together for reference.


It's hard to build laravel. Here is a summary of your own build steps:Operating system: Mac OS X 10.9.4The PHP development environment for the initial operating system is: apache2.2.25+php5.4.30+mysql5.5.38Because I prefer to toss. These environments have been upgraded and the upgraded environment is: apache2.4.10+php5.5.14+mysql5.5.38The following are the specific steps:

1. First upgrade Apache:

Go to official website to download Apache source package httpd-2.4.10.tar.gz

TAR-ZXVF httpd-2.4.10.tar.gz

CD httpd-2.4.10

./configure--enable-so

Make

Make install

When installing Apache may encounter a variety of problems, I encountered the problem is not find Xcode gcc compiler, but I installed Xcode, but not the system default Xcode, installed is the latest Xcode, the path is not clear, as if it can not find/application /xcode.app/contents/... There is a large string behind, configure when the hint can not find this gcc compiler, but I clearly have, so I can find the GCC compiler path, do a soft connection mapping, after the installation of Apache is successful.

Commands for soft connection mappings:

sudo ln-s/application/xcode3.beta.app/contents/.../usr/cc/application/xcode.app/contents/ ...

The path is not clear, then there is no ah, what to write down their mistakes.

As for how to find the location of this GCC command, you can use Find, or locate,

With the Find command is slow, I do not use, if you want to use the command: Find to search for the file to search the path, or you can man find, really do not say Baidu Bar.

I use locate, the system seems to have no locate database. You need to create it yourself, command:

sudo launchctl load-w/system/library/launchdaemons/com.apple.locate.plist

If you need to upgrade the locate database, tap the command:

Sudo/usr/libexec/locate.updatedb

You can also modify the. Bash_profile,alias a quick command, lest you knock on such a long path

Well, Apache should be able to, if still not, continue to Baidu, you rest assured that you have encountered problems that others must have encountered.

2. Install PHP,

Install PHP is compared to egg pain, the first I used is the source package installation, I was the idea is to see what problems I will encounter, sure enough, I downloaded the latest PHP source code, in the Configure encountered a series of problems, In fact, that is, you have to give your PHP load extension if it is your own source package installation will be very troublesome. We recommend that you do not do this, wasting time.

Already has the master to help us to do a very good package management tool, homebrew, this tool has helped us to solve the PHP dependency package easily, resembles the yum,apt-get and so on the command.

I have a lot of problems with the egg when I install PHP, I will not waste your time by some of the steps I compiled myself.

If you follow my steps, using homebrew to install PHP, you should explode a/usr/sbin/apxs this file can not find the error.

This error is very well solved, the same as we build a soft connection map, the rest of the./configure,make,make install should be no problem.

The APXS path of the newly upgraded Apache should be/USR/LOCAL/APACHE2/BIN/APXS

Okay, here's the work of PHP's build environment, basically solved.

As for how MySQL is installed, so easy. I won't have to cut the crap.

Although the PHP environment is set up, but this homebrew does not help us to configure PHP, if you follow my steps, run laravel should also be missing a mcrypt extension.

So corresponding to your PHP version, the next PHP package, here I use php-5.5.14

After downloading this package, unzip the sudo tar-zxvf php-5.5.14.tar.gz

CD Php-5.5.14/ext/mcrypt

./configure

Phpize

[Note: If cannot find phpize can use the same method as above to establish a soft connection, phpize in your newly installed PHP location should be/usr/local/homebrew/cella/php55/5.5.14/bin/, in this directory has PHP , Phpize,php-config, these commands are all used, and they are all mapped to the/usr/local/bin directory. ]

Make

Well, by this, the mcrypt.so extension has been generated.

Assuming that you are now in this Php5.5.14/ext/mcrypt directory, execute this command:

sudo cp modules/mcrypt.so/usr/local/lib/php/extensions/

Modify your PHP.ini

Add this sentence:

extension=/usr/local/lib/php/extensions/

OK, restart, Apache

Sudo/usr/local/apache2/bin/apachectl restart

OK, run your laravel.

Congratulations.


I still cut a picture, laravel this thing is very strong, it is worth studying.

Go to bed.

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.