Composer'll downloading dependency library automatically, and it'll create a single autoloader.php and autoload all th e dependency to our project.
> Curl-ss Https://getcomposer.org/installer | Php
This method would download the composer executive file. Actually I use this before, but we can move a little further, we can directly copy the executive file to our PATH director Y.
> sudo mv composer.phar/usr/bin/composer
Verify Installation
> Composer--version
Composer version 1.0-dev (f1aa655e6113e0efa979b8b09d7951a762eaa04c) 2015-08-20 11:59:54
2. Create the Sample Project
There is a lot of great source from here https://packagist.org/
This command would create a sample REST PHP project for us.
> Composer Create-project laravel/lumen easyphprest
Go to that directory. This command would tell us a lot of useful commands.
> PHP Artisan
Laravel Framework version Lumen (5.1.3) (Laravel components 5.1.*)
Command to start the HTTP Service
> PHP Artisan Serve
Lumen development server started on Http://localhost:8000/
Install and Configure MYSQL
After directly install the DMZ file on MAC, I start MySQL as follow:
> Sudo/usr/local/mysql/support-files/mysql.server Start
Database configuration is in this place
>cat. env
Db_connection=mysql
Db_host=localhost
db_port=3306
Db_database=easyphprest
Db_username=easyphprest
Db_password=easyphprest
Exception:
Configure:error:Cannot find MySQL header files under
ERROR: '/private/tmp/pear/install/pdo_mysql/configure ' failed
Solution:
Manually install that
Http://stackoverflow.com/questions/384809/pdo-mysql-driver-on-mac
> pecl Download Pdo_mysql
> Tar zxvf pdo_mysql-1.0.2.tgz
> phpize
>./configure--with-pdo-mysql=/usr/local/mysql
> Make
Fail Exception:
./php_pdo_mysql_int.h:25:10:fatal error: ' mysql.h ' File not found
#include
Easily copy all the MySQL headers files here
> cp/usr/local/mysql/include/*.h./
> Make
Maybe, I need to reinstall my PHP with this PDO MYSQL enable.
Reinstall PHP
http://sillycat.iteye.com/blog/2223621
Fetch the latest PHP
> wget http://ar2.php.net/distributions/php-5.6.11.tar.gz
Unzip and Installation
>./configure--prefix=/users/carl/tool/php-5.6.11--with-openssl--with-iconv-dir=/usr/lib--with-curl=/opt/ Local/include/curl--with-mysql--enable-fpm--with-zlib-dir--with-freetype-dir--enable-mbstring--with-libxml-dir =/USR--enable-soap--enable-calendar--with-mysqli--with-pdo-mysql--with-zlib
After installation, switch to this latest version of PHP. It works.
> PHP Artisan Migrate
Migration table created successfully.
Migrated:2015_08_28_183001_create_books_table
Laravel-web Framework similar to Symfony2
http://www.golaravel.com/
Http://laravel-china.org/docs/4.2/introduction
http://www.golaravel.com/
Lumen-restful Framework Mini version of Laravel
http://lumen.laravel.com/
http://segmentfault.com/a/1190000002724037
http://lumen.laravel-china.org/
https://phphub.org/topics/701
Http://lumen.laravel-china.org/docs
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