I am totally new to laravel. I would like to use it in my project
I downloaded WAMP Stack 7.1.26-2 from http://bitnami.com and to my surprise,it already came with laravel pre-installed.
It is in the frameworks folder as in:C:\Bitnami\wampstack-7.1.26-2\frameworks
But my problem is that I do not kinow how to use laravel from there.It is not in the htdocs folder as I think it s supposed to be.
If I go to http://localhost I see only the bitnami welcome page
If i go to http://localhost/laravel ,it says PAGE NOT FOUND
I searched online for the answer but most of the time,it points me to this link:
https://docs.bitnami.com/google/apps/#laravel
But on that page, I see NOTHING relating to laravel.I cannot even find the word 'laravel' with a browser search.
If I run composer create-project laravel/laravel myproject --prefer-dist ,
I get this:
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\o.o amoo>composer create-project laravel/laravel myproject --prefer-dist
PHP Warning: PHP Startup: Unable to load dynamic library 'C:/Bitnami/wampstack-
7.0.0RC7-/php/ext\php_solr.dll' - The specified module could not be found.
in Unknown on line 0
Installing laravel/laravel (v5.5.28)
- Installing laravel/laravel (v5.5.28): Loading from cache
Created project in myproject
> #php -r "file_exists('.env') || copy('.env.example', '.env');"
PHP Warning: PHP Startup: Unable to load dynamic library 'C:/Bitnami/wampstack-
7.0.0RC7-/php/ext\php_solr.dll' - The specified module could not be found.
in Unknown on line 0
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 73 installs, 0 updates, 0 removals
- Installing symfony/thanks (v1.1.0): Loading from cache
- Installing symfony/polyfill-ctype (v1.10.0): Loading from cache
Invalid zip file, retrying...
- Installing symfony/polyfill-ctype (v1.10.0): Loading from cache
Invalid zip file, retrying...
- Installing symfony/polyfill-ctype (v1.10.0): Loading from cache
Failed to download symfony/polyfill-ctype from dist: 'C:\Users\o.o amoo\
myproject\vendor/symfony/polyfill-ctype/4199a310f6ba3768faedee6d521ec615' is not a zi
p archive.
Now trying to download from source
- Installing symfony/polyfill-ctype (v1.10.0): Cloning e3d8262452
[RuntimeException]
Failed to clone https://github.com/symfony/polyfill-ctype.git via https, ssh p
rotocols, aborting.
- https://github.com/symfony/polyfill-ctype.git
Cloning into 'C:\Users\o.o amoo\myproject\vendor\symfony\polyfill-ctype'...
fatal: unable to access 'https://github.com/symfony/polyfill-ctype.git/': Fa
iled to connect to github.com port 443: Timed out
- git#github.com:symfony/polyfill-ctype.git
Cloning into 'C:\Users\o.o amoo\myproject\vendor\symfony\polyfill-ctype'...
ssh: connect to host github.com port 22: Connection timed out
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
create-project [-s|--stability STABILITY] [--prefer-source] [--prefer-dist] [--r
epository REPOSITORY] [--repository-url REPOSITORY-URL] [--dev] [--no-dev] [--no
-custom-installers] [--no-scripts] [--no-progress] [--no-secure-http] [--keep-vc
s] [--remove-vcs] [--no-install] [--ignore-platform-reqs] [--] [<package>] [<dir
ectory>] [<version>]
C:\Users\o.o amoo>
That made me soo confused.It did make a project called myproject was made in : C:\Users\o.o amoo>
but laravel couldn't be installed???
If I try php artisan serve I get:
Could not open input file:artisan
So with that,can I access myproject with laarvel if so,how?If not how come and what do I do?
Someone please point me in the right direction...
Thanks!!!
Alright let's start with why your project is installed in C:/Users it's because you use --prefer-dist in composer create-project laravel/laravel myproject --prefer-dist.
--prefer-dist: Reverse of --prefer-source, composer will install from dist if possible. This can speed up installs substantially on build
servers and other use cases where you typically do not run updates of
the vendors. It is also a way to circumvent problems with git if you
do not have a proper setup.
Second you run into errors maybe because you are in a directory that require additional rights, at least that's how it looks to me.
If you have installed Laravel correctly you should be able to navigate trough a terminal to the desired location, and either use laravel new BUT only if you are already in the directory that you want say C:/Code/myproject if you are still in C/Code you need to do laravel new myproject
If this doesn't work for you I would suggest you to verify that you installed everything according to the docs
And last but most important I want to mention 1 more thing for you, in Laravel it is really more convinient to use Homestead. You can read more for what is Homestead, how to install, configure and work with it here :
https://laravel.com/docs/5.8/homestead
Related
I installed Laravel in my MAC, but I have a problem when I start the install
Installing laravel/laravel (v5.6.21)
- Installing laravel/laravel (v5.6.21): Loading from cache
Created project in laravel
#php -r "file_exists('.env') || copy('.env.example', '.env');"
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 70 installs, 0 updates, 0 removals
- Installing vlucas/phpdotenv (v2.5.0): Downloading (100%)
[ErrorException]
copy(/Users/mohammadreza/.composer/cache/files/vlucas/phpdotenv/860e02c1487d4eaac63d29a77c5fa31c2739df62.zip): failed to open stream: Permission denied
Please help me
"The failed to open stream: Permission denied" part is the key part. It's telling you it couldn't open a file stream because it doesn't have permissions to do so. This would indicate the user executing PHP doesn't have required file permissions. If you are running PHP from within another framework (such as Apache) then you need to look there to see what user is being used to run PHP. If you're running PHP directly yourself, then you need to see what user you're running it at as. Then you need to make sure that user has permissions to do the operation.
That's about the best answer I can give without specifics of your system architecture and installation settings.
NOTE: I've never used laravel before. I'm just telling you what the error is indicating.
You can try sudo composer global require "laravel/installer"
If that still not works consider create your laravel project via
Via Composer Create-Project, e.g.
composer create-project --prefer-dist laravel/laravel your-project-name
For the details installation please refer
https://laravel.com/docs/5.6
Hope it helps :)
I have a fresh install of Symfony with everthing looking in-place apart from my vendors directory is empty? That is, it has
composer and doctrine directories in it but they are empty. If I stand in my root and run the command:
$ composer install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
- Installing doctrine/lexer (v1.0.1)
Downloading: 100%
Failed to download doctrine/lexer from dist: Could not decompress the archive, enable the PHP zip extension.
The php.ini used by your command-line PHP is: /etc/php5/php.ini
Now trying to download from source
- Installing doctrine/lexer (v1.0.1)
Cloning 83893c552fd2045dd78aef794c31e694c37c0b8c
[RuntimeException]
Failed to clone git#github.com:doctrine/lexer.git via git, https, ssh protocols, aborting.
- git://github.com/doctrine/lexer.git
Cloning into '/cygdrive/c/Apache24/htdocs/symfony.local/vendor/doctrine/lexer'...
fatal: remote composer already exists.
- https://github.com/doctrine/lexer.git
fatal: destination path '/cygdrive/c/Apache24/htdocs/symfony.local/vendor/doctrine/lexer' already exists and is not an empty directory.
- git#github.com:doctrine/lexer.git
fatal: destination path '/cygdrive/c/Apache24/htdocs/symfony.local/vendor/doctrine/lexer' already exists and is not an empty directory.
At the front end browsing to http://symfony.local/web/
Warning: require(C:\Apache24\htdocs\symfony.local\app/../vendor/autoload.php): failed to open stream: No such file or directory in C:\Apache24\htdocs\symfony.local\app\autoload.php on line 11
Fatal error: require(): Failed opening required 'C:\Apache24\htdocs\symfony.local\app/../vendor/autoload.php' (include_path='.;c:\php\includes') in C:\Apache24\htdocs\symfony.local\app\autoload.php on line 11
Clearly it's looking for /vendor/autoload.php but this isn't there. Why is my vendor directory empty and how can I ensure the libraries get installed?
$ composer update returns:
Loading composer repositories with package information
Updating dependencies (including require-dev)
- Installing paragonie/random_compat (1.1.4)
Downloading: 100%
Failed to download paragonie/random_compat from dist: Could not decompress the archive, enable the PHP zip extension.
The php.ini used by your command-line PHP is: /etc/php5/php.ini
Now trying to download from source
- Installing paragonie/random_compat (1.1.4)
Cloning d762ee5b099a29044603cd4649851e81aa66cb47
[RuntimeException]
Failed to clone git#github.com:paragonie/random_compat.git via git, https, ssh protocols, aborting.
- git://github.com/paragonie/random_compat.git
Cloning into '/cygdrive/c/Apache24/htdocs/symfony.local/vendor/paragonie/random_compat'...
fatal: remote composer already exists.
- https://github.com/paragonie/random_compat.git
fatal: destination path '/cygdrive/c/Apache24/htdocs/symfony.local/vendor/paragonie/random_compat' already exists and is not an empty directory.
- git#github.com:paragonie/random_compat.git
fatal: destination path '/cygdrive/c/Apache24/htdocs/symfony.local/vendor/paragonie/random_compat' already exists and is not an empty directory.
Well, your PHP is not properly configured.
Adjust your /etc/php5/php.ini and enable the "ZIP" extension.
And the rest is probably a permissions issue, because you are using Cygwin in combination with Composer. Composer and Cygwin are not really best friends.
My suggestion: run Composer on the native Windows CLI, just for the vendor fetching part.
What you want is composer update. It will read your composer.json to install all required packages. composer install is used for deployment.
Download and enable the zip extention for PHP
If you are using PHP7.0 and use a debian base distribution (Ex: Ubuntu), use the following to install and enable it automaticaly
apt-get install php-zip
I'm new to Yii2, now I'm trying to install yii2 application advanced template.
I did follow these steps:
1 - Download yii2-app-advanced zip file from https://github.com/yiisoft/yii2-app-advanced
2 - Follow GETTING STARTED guide:
+ I'm using Uniform Zero Server (installed in F disk with the path "F:\Server\UniServerZ\www") ok.
+ I creted new folder with name "yii2" in the "www" directory ("F:\Server\UniServerZ\www\yii2")
+ I extracted zip file yii2-app-advanced into "yii2" folder (Every source of yii2-app-advanced now in "yii2" folder so it is the root directory of yii2-app-advanced)
+ Click init.bat file to run "init" and select (0 - Developer mode) and type "yes" to confirm. Done
+ And then I click the yii.bat file, but nothing happened.
+ I tried use this url : localhost/yii2/backend/web/
And I get this Error:
Fatal error: require(): Failed opening required 'F:\Server\UniServerZ\www\yii2\backend\web/../../vendor/autoload.php' (include_path='.;F:/Server/UniServerZ/home/us_pear/PEAR') in F:\Server\UniServerZ\www\yii2\backend\web\index.php on line 5
or url : localhost/yii2/frontend/web/
And I get this Error too:
Fatal error: require(): Failed opening required 'F:\Server\UniServerZ\www\yii2\frontend\web/../../vendor/autoload.php' (include_path='.;F:/Server/UniServerZ/home/us_pear/PEAR') in F:\Server\UniServerZ\www\yii2\frontend\web\index.php on line 5
I checked the "vendor" directory follow this path:
F:\Server\UniServerZ\www\yii2\vendor
But it's empty.
So what should I do to fix this error and install yii2 application advanced template?
(My Uniform Server runs PHP5.4)
Yii2 Installation Following command:
(1) First install Composer (LINUX):
Locally:
curl -sS https://getcomposer.org/installer | php
OR
(1) First install Composer (WINDOWS):
C:\Users\username>cd C:\bin
C:\bin>php -r "readfile('https://getcomposer.org/installer');" | php
Note: If the above fails due to readfile, use the http url or enable php_openssl.dll in php.ini
C:\bin>echo #php "%~dp0composer.phar" %*>composer.bat
C:\Users\username>composer -V
Composer version 27d8904
(2) Yii2 framework online downloads:
Basic App:
php composer.phar create-project yiisoft/yii2-app-basic basic 2.0.0-beta
Advanced App:
php composer.phar create-project yiisoft/yii2-app-advanced advanced 2.0.0-beta
(3) Other App Settings Command:
php init
php yii migrate
If you are working on linux, go to the downloaded project and in the terminal type (if you have a composer):
php composer.phar install
If the composer is not installed go to https://getcomposer.org/download/ After this, yii2 framework and other extensions will be installed at vendor directory. This should fix the problem
Install with composer :
D:\wamp\www> composer create-project --prefer-dist --stability=dev yiisoft/yii2-app-advanced D:\wamp\www\myyii2app
and run php ./init
D:\wamp\www\myyii2app>php ./init
Under Linux, cd to the directory of the downloadable project using Terminal and run the following commands:
$ php init --env=Development
$ curl -sS https://getcomposer.org/installer | php
$ php composer.phar update
Installing using Composer
If you do not have Composer, follow the instructions in the Installing Yii section of the definitive guide to install it.
With Composer installed, you can then install the application using the following commands:
composer global require "fxp/composer-asset-plugin:~1.1.1"
composer create-project --prefer-dist yiisoft/yii2-app-advanced yii-application
The first command installs the composer asset plugin which allows managing bower and npm package dependencies through Composer. You only need to run this command once for all. The second command installs the advanced application in a directory named yii-application. You can choose a different directory name if you want.
Install from an Archive File
Extract the archive file downloaded from yiiframework.com to a directory named advanced that is directly under the Web root.
Then follow the instructions given in the next subsection.
Preparing application
After you install the application, you have to conduct the following steps to initialize the installed application. You only need to do these once for all.
Execute the init command and select dev as environment.
php /path/to/yii-application/init
Otherwise, in production execute init in non-interactive mode.
php /path/to/yii-application/init --env=Production --overwrite=All
Create a new database and adjust the components['db'] configuration in common/config/main-local.php accordingly.
Apply migrations with console command yii migrate.
A php component might be missing, i installed mbstring, then restarted the whole process.
yum -y install php54w_mbstring
composer init
composer create-project --prefer-dist
--stability=dev yiisoft/yii2-app-basic <project-name>
****To install YII2-Advance use these command at your CMD. And see bellow...........****
Microsoft Windows [Version 10.0.10586]
(c) 2015 Microsoft Corporation. All rights reserved.
C:\Users\admin>e: (RUN COMMAND)
E:>cd xampp/htdocs (RUN COMMAND)
E:\xampp\htdocs>composer create-project --prefer-dist yiisoft/yii2-app-advanced yii-application (RUN COMMAND)
Installing yiisoft/yii2-app-advanced (2.0.9)
- Installing yiisoft/yii2-app-advanced (2.0.9)
Loading from cache
Created project in yii-application
Loading composer repositories with package information
Updating dependencies (including require-dev)
- Installing yiisoft/yii2-composer (2.0.4)
Downloading: 100%
Installing swiftmailer/swiftmailer (v5.4.3)
Downloading: 100%
Installing bower-asset/jquery (2.2.4)
Downloading: 100%
Installing bower-asset/yii2-pjax (v2.0.6)
Downloading: 100%enter code here
Installing bower-asset/punycode (v1.3.2)
Downloading: 100%
Installing bower-asset/jquery.inputmask (3.2.7)
Downloading: 100%
Installing cebe/markdown (1.1.0)
Downloading: 100%
Installing ezyang/htmlpurifier (v4.8.0)
Downloading: 100%
Installing yiisoft/yii2 (2.0.9)
Downloading: 100%
Installing yiisoft/yii2-swiftmailer (2.0.5)
Downloading: 100%
Installing yiisoft/yii2-codeception (2.0.5)
Downloading: 100%
Installing bower-asset/bootstrap (v3.3.7)
Downloading: 100%
Installing yiisoft/yii2-bootstrap (2.0.6)
Downloading: 100%
Installing yiisoft/yii2-debug (2.0.6)
Downloading: 100%
Installing bower-asset/typeahead.js (v0.11.1)
Downloading: 100%
Installing phpspec/php-diff (v1.1.0)
Downloading: 100%
Installing yiisoft/yii2-gii (2.0.5)
Downloading: 100%
Installing fzaninotto/faker (v1.6.0)
Downloading: 100%
Installing yiisoft/yii2-faker (2.0.3)
Downloading: 100%
Writing lock file
Generating autoload files
E:\xampp\htdocs>cd yii-application (RUN COMMAND)
E:\xampp\htdocs\yii-application>php init (RUN COMMAND)
Yii Application Initialization Tool v1.0
Which environment do you want the application to be initialized in?
[0] Development
[1] Production
Your choice [0-1, or "q" to quit] 0 (Enter with 0 RUN COMMAND)
Initialize the application under 'Development' environment? [yes|no] yes (Enter with yes RUN COMMOND)
Start initialization ...
... initialization completed.
E:\xampp\htdocs\yii-application>yii migrate (RUN COMMOND)
Yii Migration Tool (based on Yii v2.0.9)
Creating migration history table "migration"...Done.
Total 1 new migration to be applied:
m130524_201442_init
Apply the above migration? (yes|no) [no]:yes
*** applying m130524_201442_init
create table {{%user}} ... done (time: 0.225s)
*** applied m130524_201442_init (time: 0.310s)
1 migration was applied.
Migrated up successfully.
Finally created yii-application folder in htdocs
E:\xampp\htdocs\yii-application>
If you want to install Yii2 advanced template go to http://www.yiiframework.com/download/ and download the Yii 2 with advanced application template. Once you have extracted the archive file in the www folder.
Then Go to Terminal(For Ubuntu) or cmd(Windows user)
For Ubuntu-
provide root to the extracted folder(advanced) in the Terminal
cd var/www/html/ashish/advanced
Now give the commond- php init
Now advance template is installed properly
I am using Symfony 2.3.4
On my console i did composer create-project sylius/sylius --prefer-dist
Everything downloaded smoothly until it came to installing sensio/distribution-bundle
Composer throw out this error message
[Composer\Downloader\TransportException]
The "https://api.github.com/repos/sensio/SensioDistributionBundle/zipball/4
a2c803dc8db79952ad5e71783c16178427bbc02" file could not be downloaded (HTTP
/1.1 404 Not Found)
create-project [-s|--stability="..."] [--prefer-source] [--prefer-dist] [--repos
itory-url="..."] [--dev] [--no-dev] [--no-plugins] [--no-custom-installers] [--n
o-scripts] [--no-progress] [--keep-vcs] [package] [directory] [version]
I tried :
Editing sylius/composer.json and modify "sensio/distribution-bundle": "2.3." to "sensio/distribution-bundle": "2.2.-dev"
Open a shell in C:\wamp\www\sylius. Rename app/config/parameters.yml.dist to parameters.yml, run php composer.phar update --prefer-dist, still having lots of errors about MongoDb
Is there any other way to install sylius?
How can i fix this?
Thanks heaps
It seems that sylius build in 0.1.0 is broken. If you want functional sylius installation you have to use dev-master version.
composer create-project sylius/sylius sylius dev-master
They fixed the issue! The problem was indeed with the Sylius build. Today i created a freshly installed Symfony2 onto my server, and did composer composer create-project sylius/sylius --prefer-dist
Sensio/SensioDistributionBundle installed correctly.
Steps to installed Sylius
1. composer create-project sylius/sylius --prefer-dist (this method download compressed file when available) or composer create-project -s dev sylius/sylius
make sure to enable php_info extension
create a database in php myadmin
cd sylius and then php app/console sylius:install
The last part of the installation will asked you for some parameters, the default option given works fine. Accustomed it to your config
I spend 48 hours trying to install sylius finally things got better now.
There is many issues with Sylius at the moment. Check Out And is really slow. I am still finding a way to speed things up. I took like 3 minutes to load when i clicked on Register.
If you got issued like MongDB not found, or any bundle not found, then surely there is a problem with the way you are trying to install Sylius. And Please at the moment do not cd sylius and composer update, it won't worked. I got told that they rearranged the bundle.
You can find more detailed Click here!
Please feel free to edit this post if you feel that there is something that i haven't talked about for sylius installation.
Thanks to Sylius Contributors!
I am trying to install Symfony2 via composer on an Ubuntu server:
php composer.phar create-project symfony/framework-standard-edition /var/www/dev/myproject 2.1.7
but it fails with the following error:
- Installing doctrine/doctrine-bundle (v1.1.0)
Downloading: 100%
rm: cannot remove `/var/www/dev/myproject/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle': Directory not empty
[ErrorException]
ZipArchive::extractTo(): File name too long
Google didn't help, any idea what the problem could be?
Thanks!
try by going inside the directory where you want to install it and then execute
php composer.phar create-project symfony/framework-standard-edition myproject 2.1.7
I guess the problem had to do with the linux server being a VM and the folder I tried to install symfony2 in was a folder shared from windows (the host) ...
After rebooting that error went away (leaving me with lots of random composer errors, but those are not in the scope of this question ;))