Very early Phphub out when I went to register an account, and its source is on GitHub on the open source, then want to build their own play, it is based on Laravel, but I have been in contact with the CI and Yii, will not laravel, so in Http://lara Vel-china.org/docs/5.0 began to learn to configure the environment, then the installation of composer trapped Me (Windows), and then continue my yii. After looking at the discourse, in the Linux (Ubuntu) oneself also constructs the late, suddenly thought oneself constructs phphub this matter has not finished yet. The environment installation configuration is then started.
Composer official website https://getcomposer.org/. At first, use curl.
Curl-ss Https://getcomposer.org/installer | Php
But did not succeed, and then just download the installation package under the page, the installation is always installed, the background search only know is php.ini inside the OpenSSL need to open
Extension=php_openssl.dll
Then retry the installation, then open the cmd input
Composer-v
Displays the relevant information successfully.
The following is the official way to install Laravel.
Composer global require "laravel/installer=~1.1"
But because of the speed of the "You know" Always install failure, no way to search the solution. Open cmd input
Composer Config-l-G
In the result of the output, where the "home" configuration item content is our composer home directory, and then edit the Config.json file in the Cmposer home directory as:
{ "config": {}, "repositories": [ { "type": "Composer", "url": "http://comproxy.cn/repo/ Packagist " }, { " packagist ": false } ]}
After saving, execute the command to install Laravel.
The next step is to create a project in the official way.
Laravel New Laravel-blog
I use Apache, after creation in the WWW directory, after the browser input 127.0.0.1/laravel-blog access to our project, but in the browser display is indeed the entire project directory structure, input 127.0.0.1/laravel-blog/ Public access to the public directory of the index.php, this is not even the installation is complete ...
Open App/http/controllers We can see homecontroller.php file:
Middleware (' auth '); } /** * Show The application dashboard to the user. * * @return Response * * Public Function index () { return view (' Home ');} }
In the browser input 127.0.0.1/laravel-blog/home This is the last thing we want to see.
Not Found
The requested url/laravel-blog/home is not found on this server.
On the Laravel tutorial site I did not find this solution, in the root directory there is only one server.php, there is no common import file index.php, I try to add the. htaccess file in the root directory and change the index.php of the Serv er.php, but still no effect.
options-multiviews
rewriteengine on # Redirect Trailing slashes ... Rewriterule ^ (. *)/$/$1 [l,r=301] # Handle Front Controller ... Rewritecond%{request_filename}!-d rewritecond%{request_filename}!-f rewriterule ^ server.php [L]
So asked @JohnLui, the original is laravel different we often contact CI, Yii, etc. is the project root directory index.php as the entrance, so in the browser address input 127.0.0.1/laravel-blog/public/home found that it did.
So when we are learning laravel, it is best not to use this subdirectory to access, but through the port access, so we open the Apache configuration file, at the bottom of the port through the way the port directly point to the public folder. (Of course you need to add the corresponding Listen in the config file 8010)
ServerAdmin yangyun4814@gmail.com documentroot "E:\phpEnv\www\laravel-blog\public"
Then restart Apache, which can be accessed via the browser input 127.0.0.1:8010.
Finally, we can continue to study laravel happily.