Hello I am trying to install symfony on Windows. I had follow the all require steps for it but it end up with below message.
[RuntimeException]
Symfony can't be installed because the downloaded package is corrupted.
To solve this issue, try executing this command again:
Symfony new demo 3.2.8
When i tried above command it says :
'symfony' is not recognized as an internal or external command,
operable program or batch file.
I have try to reinstall composer and Symfony package both but it does not resolve the issue. It stays the same issue again.
Please help me how can I install it on Windows.
You are required to make it run through PHP as its a script file.
This gets the installer (which it looks like you have already)
php -r "readfile('https://symfony.com/installer');" > symfony
Then php symfony new demo 3.2.8 (asuming if php is in path otherwise you have to specify the php.exe path too)
For the full details see http://symfony.com/doc/current/setup.html
Regards
forget about that installer use composer from command line
composer create-project symfony/framework-standard-edition my_project_name
BTW i don't know what server you are using (wamp/xamp etc), i recomending this
https://laragon.org/
it have composer and all tools that you need to start with symfony
Related
I am using windows server 2008 os. i download composer setup.exe and install to my PC . when I try composer install . I getting an error:
'composer' is not recognized as an internal or external command,
eg:-
c:\xampp\htdocs\shop>composer install
'composer' is not recognized as an internal or external command,
operable program or batch file.
My environment variable PATH is shown below:
C:\xampp\php\;C:\Users\Administrator\AppData\Roaming\Composer\vendor\bin
For anyone coming here from Google who are facing the same issue. I just managed to solve this issue after all the other "solutions" other people suggested didn't work.
I installed Composer properly and the Environment variable was set but it just wouldn't work.
In my case composer is installed in C:\ProgramData\ComposerSetup\bin and this is exactly what is in my PATH Environment variable. After messing around a bit trying to fix it I saw that under System variables under PATH there is something called PATHEXT I opened that and added ;.PHAR to the end of it. So it ended up like this:
And this is what my PATH is now:
I closed all file explorer windows and command prompts and started a new CMD and ran composer --version and it worked!
I hope this helps someone facing the same issue as me.
https://getcomposer.org/doc/00-intro.md#installation-windows
Close your current terminal and open a new one.
I had the same problem, I kept repeating the composer installation until it was resolved this way:
1) Download the composer installer (.exe) and put it on C:/XAMPP.
2) Run the installer by just clicking next till the end.
3) Open command-line (cmd) and cd to your project directory (C:/XAMPP/htdocs/myproject) and type composer and see if you have it installed.
4) It should work now, let's say you want to install a PHP framework from your project directory: cmd=>composer require slim/slim "^3.0".
I had the same problem .
In my case i used the command "php composer.phar " instead of "Composer " and it worked .
just paste " echo #php "%~dp0composer.phar" %*>composer.bat " This in your Terminal where you install composer and Boom you get the solution.
The solution is to use complete composer path instead of composer install
eg:- C:\ProgramData\ComposerSetup\bin\composer install" instead of "composer install
Better still, add "C:\ProgramData\ComposerSetup\bin\" to your environment variables, so that you can use "composer install".
If u can't find composer file than follow only 2 steps
1- Download composer file from [https://getcomposer.org/download/]<click on Composer-Setup.exe>
2- Install above file at your project root dir. and give second path is your php.exe file and finally solve this issue.
Simply use
like this
C:\jay\xampp\htdocs\zoho1>php composer.phar require zohocrm/php-sdk
You Just Don't need to worry about this if you have installed composer using Command-line installation than this problem will occurs.
So my suggestion is to download .exe file by visiting this link https://getcomposer.org/
And also after download using this link you don't need to use php composer.phar instead of composer only
I was facing the same issue in installing the composer command in cmd but when I closed all windows file explorers and again run this command "composer global require laravel/installer " from "**https://laravel.com/docs/8.x**". It just installed without any error
remove all your playings with composer path in path variable
go to https://getcomposer.org/doc/00-intro.md#using-the-installer
and find Composer-Setup.exe link to that exe.
I can solve this problem easily without do anything.
Suppose I'm going to create a project in my desktop and facing the problem which you have shown in the description. now follow the step.
Project folder on desktop
Step 1: go you your CMD(Command Prompt) of your Computer
step 2:Select the folder by command here like image (cd/desktop/example folder)
Step 3: After select the folder now write the command which you want to do like screenshot . you can see Im writing the command for laravel.
done, just easy step you can work anything from here and you can see downloading and being prepare for the project
Hello. Please I am new to the php slim framework. I have tried all day to download and install slim 3 through composer but haven't been successful.
Am using a windows pc. I used command prompt and downloaded composer and installed composer to the desired directory. However, when i try installing slim 3, I get an error : "installation failed, reverting ./composer.json to its original content"
[Command Prompt Error Message][Command prompt error message]
you have to load the direction page of slim frame work using this link:
https://www.slimframework.com/docs/start/installation.html
and there will be a command like this - composer require slim/slim "^3.0"
instead of using this one you have to use this...
php composer.phar require slim/slim "^3.0"
and you will get slim installed
Kick-start Slim 3 projects using a skeleton!
With Composer installed, use the cmd line to access the C:\xampp\htdocs folder, then write this command:
$ php create-project slim/slim-skeleton [my-app-name]
Command will produce composer.json and composer.lock files along with a public/ folder that can all be committed to VCS (do not commit any other folders/dependencies).
Make sure you have high enough version of PHP, and PHP is in your PATH. To check this - print "php -v " in command line (you can pretty sure run up to PHP7).
Make sure you are in the right directory for your project.
Provide complete command line output, there could be things you didn't know to be important for a good answer.
After all, you can delete composer.json and composer.lock from the directory, and try again.
I use windows with XAMPP to run a virtual apache server.
After many similar issues, I downloaded git-bash and used it instead of the windows cmd.
give it a try, and see if that can resolve your issues.
https://git-scm.com/
I am Using my own Machine Kali Linux 2.0 Debian x64 . Now, i have Installed Laravel in my directory structure like
/opt/lampp/htdocs/learning-larvel/
Inside the Learning-laravel folder i have Installed my Laravel files, and also i installed composer. So when i go to http://127.0.0.1/learning-laravel/public . I see a See a White Screen and in Between it is written "Laravel 5", which means the Laravel GUI Setup is fine.
Now, to create a new file for Laravel, when i open my Terminal and type
laravel new xyz
then it gives me a error which says bash: laravel: command not found
Now, how can i fix the error.. I have researched about it by setting PATH to bashrc. But i am not getting it fixed right. Additionally when i type in my command composer -version then also it says bash: composer: command not found but i have Installed composer on the folder learning-laravel itself.
I could also see files like composer.phar there in /opt/lampp/htdocs/learning-larvel/
Any help would be extremely thankful.
As the composer official getting started page points out:
There are in short, two ways to install Composer. Locally as part of
your project, or globally as a system wide executable.
if you wanna do composer -- or laravel -- in command line, you wanna install them globally.
Check out the following links:
https://getcomposer.org/doc/00-intro.md#installation-linux-unix-osx
https://laravel.com/docs/4.2#install-laravel
I encountered the same problem. Apparently, the composer exists in path ~/.config/composer/vendor/bin when running as super user. Therefore, replacing the paths which were described above by this, and it should work. Hope it helps.
i am lost...
i am trying to do it the right way and am following the Quick Start Guide for installing cakePHP 3 on my ubuntu machine.
Got composer installed. Directory is /var/www/cakephp
and am trying to issue:
php composer.phar create-project --prefer-dist cakephp/app mayapp
or
composer create-project --prefer-dist cakephp/app may app
then i am simply getting:
[InvalidArgumentException]
Could not find package cakephp/app with stability stable.
i do not have a clue what i am doing wrong. Any suggestions?
cakephp/app exists on https://packagist.org, and the command looks ok to me.
Which PHP version are you using? That package is only available with PHP 5.4.16 or later, so you must update if you want to use CakePHP.
However, it is a good idea to only use the same PHP version of your public hosting, using a newer version will lead to problems when deploying your code. If your webspace or public server does not have the latest PHP 5.6 running, ask for an update.
I got same issue. But, as previous answer, myapp does not exists on packagist.org, so, you must use laravel/laravel instead, and, after created, rename the new laravel folder to your desired name and move to htdocs (for xampp) or www (for wamp), then, and I do not know why, go to : localhost/laravel/public/
and replace laravel with the name you gave to your project folder instead the laravel one.
You will see Laravel 5 fonts will appear on screen.
That's means Laravel is running.
Hey Please try these steps.
Download XAMPP Server.
Install XAMPP server.
Go to ..\xampp\php\php.ini and open.
Add this line (extension=php_intl.dll) or if exist uncomment.
Download Composer setup from https://github.com/composer/windows-setup/releases/
Install composer and give php.exe file in path
Open cmd and check now php version using command php -v. if its showing php version its means its working.
Now open cmd and cd on xampp\htdocs folder & run command composer create-project --prefer-dist cakephp/app app_name
Finished folder created in htdocs.
Hope this is helpful for you.
i used to to use composer to create a new symfony project like so
composer create-project symfony/symfony-standard-edition SymfonyProjectDir 2.5.*
but know when i want to use the symfony installer i use the command
symfony new SymfonyProjectDir 2.5.*
or
symfony new SymfonyProjectDir 2.5
but i get this error
[RuntimeException]
The Symfony version should be 2.N.M, where N = 0..9 and M = 0..99
new directory [version]
how can i tel that i want to use the version 2.5 including the last updates from symfony like i used to with composer?
There is no reason to have the latest minor version of an version. You start developing with the latest version and then you should freeze it until there is a reason to update.
If you don't care, clone the git repo, grep your tag and create your project with it.
You can try this, it worked for me:
Symfony Installation and Project Creation
Or just open command line and execute these commands:
for (linux/mac)
sudo curl -LsS http://symfony.com/installer -o /usr/local/bin/symfony
sudo chmod a+x /usr/local/bin/symfony
symfony new SymfonyProjectDir 2.5
The version will be the most recent version in 2.5, as you want
Last answer here is from 2016 so if you end up here somehow in 2019 the solution is much easier!
First make sure you are using a php version of 7.1 or higher.
Check if you have composer installed and if you don't just follow this easy documentation: Download/Install Composer
Now you are all set, go to the directory where you want your symfony project be stored and enter the command composer create-project symfony/website-skeleton my-project. This will create your first structure in symfony 4!
Now you just enter your project directory and type php bin/console server:run on your terminal and you are done.
You can import repositories from git too starting git init from the same project folder.
First time with Symfony? Follow this tutorial for a first controller/view: Introduction to symfony4
Hope this if somehow usefull to anyone, i'm just trying to give something back to this community that has given me so much.
Please try with it:
composer create-project symfony/framework-standard-edition SymfonyProjectDir/ 3.0.7
It should work. Maybe your forgot the last slash...