Symfony framework on Cloud9 - symfony

Is there a way to setup a Symfony project on Cloud9?
I found some articles on creating Yii projects this way, but nothing on Symfony.

Here you have the answer.
https://docs.c9.io/docs/symfony2
I already create one.

Note : I assume you are currently on an empty project/repository.
Run the following commands :
Download the composer.phar executable : $ curl -sS https://getcomposer.org/installer | php
Create the project on the current folder : $ php composer.phar create-project symfony/framework-standard-edition projectName/
External links :
The Symfony Book
Composer project on github

Related

Command " symfony new my_project " don't usable

Good morning,
after change my PC (windows 10 Pro), I have a few problems… to use symfony.
If I do composer create-project symfony/website-skeleton my_project all is good,
but if I do symfony new my_project --full , I obtain :
screenshot
And C:/ProgramData/ComposerSetup/bin/composer.phar exists :
screenshot-2
I don't undestand if you have an idea…
Thank you in advance.
Which Php version(s) do you have?
Try symfony local:php:list and symfony php -v commands please.
• You can force Php version 7.4.0 for example with this command: echo 7.4.0 > .php-version inside your project folder.

Can't create a new Symfony project

I can't create a new Symfony project as described in the Symfony Documentation: https://symfony.com/doc/4.3/setup.html
This is the command I use: symfony new --full my_project
Output:
$ symfony new --full my_project
WARNING The current directory seems configured for as a SymfonyCloud project, but it is not linked yet.
You can link this directory to an existing project: symfony link [project-id] (get project IDs via symfony projects)
* Creating a new Symfony project with Composer
unable to find composer, get it at https://getcomposer.org/download/: exec: "composer": executable file not found in
$PATH
I don't understand why the command can't find the composer executable.
When I just enter $ composer in my terminal, composer is executed.
This is my Symfony CLI version: Symfony CLI version v4.6.1
In my .bash_profile file, I have an alias for composer:
alias composer="php /usr/local/bin/composer.phar"
My /etc/paths:
/usr/local/bin
/usr/bin
/bin
/usr/sbin
/sbin
What is wrong in my config?
Most likely, it's because you didn't rename composer.phar.
First, do this:
mv /usr/local/bin/composer.phar /usr/local/bin/composer
It will rename composer.phar to composer.
Then you can also delete your alias.
Alias are for connected users. Executable and installer don't read your aliases, which is why symfony installer isn't finding composer.
If it doesn't solve your problem, you can try to install your Symfony project with composer directly:
composer create-project symfony/website-skeleton my_project
You can also check what php version is that your symfony is using
In my case it was linked to php 5 and by changing to php 7 problem has been resolved
To check php version linked use :
symfony local:php:list
And then to edit your php version create a .php-version file then write the version that you want to use

Symfony: command not found

I am trying working with symfony since past couple of months. Last night I did an auto remove to purge not needed repositories. After that I have not been able to create a new symfony project using the symfony command. When I run Symfony new SecurityDemo 2.8.1 in the terminal,
I get the error
Symfony: command not found
I tried installing the Symfony Installer again as directed in the documentation http://symfony.com/doc/current/setup.html. I went to my root directory and followed the installation procedure as shown in the screenshot
Still I get the same error.
All help is appreciated.
EDIT:
I am working with LAMP and am using PHP 5.6.
When I try to update the symfony Installer using symfony self-update I get the output
// Symfony Installer is already updated to the latest version (1.5.8).
Add the following line to your shell configuration file:
export PATH="$HOME/.symfony/bin:$PATH"
For me the fix was to reinstall symfony:
curl -sS https://get.symfony.com/cli/installer | bash
see here https://symfony.com/download
as far as I experienced, it does not tamper with the environment.
If you're sure you installed the symfony command properly you have to call it with lowercase s and not Symfony.
The correct command is:
$ symfony new SecurityDemo 2.8.1
http://symfony.com/doc/current/setup.html#basing-your-project-on-a-specific-symfony-version
Try call Symfony it in lowercase as example:
>symfony new SecurityDemo 2.8.1
Hope this help
I had the same problem. The right command would be:
php symfony new SecurityDemo 2.8.1
Not sure why it would not work without the word php even though the documentation does not prescribe it.
cd your-project/
composer require symfony/web-server-bundle --dev
php bin/console server:start
Working beautifully for me on Fedora 33 Workstation
base: https://symfony.com/doc/4.0/setup/built_in_web_server.html
Turns out that I cannot use capital 'S' in symfony. using symfony new project_name did the trick.
The Right Command is
symfony new SecurityDemo 2.8.1
If you can’t use the Symfony installer for any reason, you can create Symfony applications with Composer, the dependency manager used by modern PHP applications.
composer create-project symfony/framework-standard-edition SecurityDemo "2.8.1"
make sure you've already install composer.
When you run curl -sS https://get.symfony.com/cli/installer | bash to install Symfony CLI Installer. After installation run either of the next commands:
Use it as a local file:
/root/.symfony5/bin/symfony
Or add the following line to your shell configuration file:
export PATH="$HOME/.symfony5/bin:$PATH"
Or install it globally on your system:
mv /root/.symfony5/bin/symfony /usr/local/bin/symfony
Then start a new shell and run 'symfony'
try this
composer require symfony/flex
composer install

Symfony 2 -> Composer and CloudControl

I have a little problem to setup Symfony 2 on Cloudcontrol,
I followed the instructions and installed a Symfony 2 framework, changed the document root and so on.
Now when I try to push the changes to server server, it loads the dependencies from the composer.json and then it failed with a message :
[RuntimeException]
Could not scan for classes inside "/srv/tmp/builddir/code/vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Resources/stubs" which does not appear to be a file nor a folder
This file is a vendor package, loaded from composer.
I have the same effect with a default composer.json file from a sample project (SF2)
Localy it works very well!
Can some one give me a hint ?
Got same error after setting "minimum-stability":"dev" and running composer update.
for unknown reason symfony/symfony (dev-master ...) kept failing to download from source thus was being loaded from cache.
what worked for me was a mix of previous answers:
$ rm -rf vendor/symfony
$ composer clearcache
$ composer install
Sometimes I had to clean composer cache to remove strange errors, usually it's in
/home/user/.composer/cache
You can also try to update composer with
php composer.phar self-update
I hope it runs for you.
I had the exact same error in my development directory.
What fixed it was :
$ rm -rf vendor/symfony
$ php composer.phar install
It reinstalled symfony/symfony, symfony/icu, symfony/assetic-bundle, symfony/monolog-bundle and symfony/swiftmailer-bundle and now everything works !

Upgrade my Symfony2 app to use composer

I want to upgrade my app that I've developed with Symfony2 for users who want to use it do so with composer.
I don't know how to create composer.json file based on deps file.
This's my deps file: https://github.com/biruwon/Vecinos2.0/blob/master/deps
For example, what about with the bundles without composer.json? Or libraries how TCPDF upload on sourceforge?
If you help me here or with a pull request I'll be very thankful to you.
PD: I do this first and then update Symfony2 to Symfony2.1
For TCPDF it's quite easy it is on packagist already.
For bundles or libs that are not on packagist, the best way is to first get it to work in your project using a custom package repository in your composer.json, and once that's done sending a pull request to the original author with a composer.json and asking them to submit it to Packagist is the way to go.
Download the composer in symfony2 root folder:
curl -s https://getcomposer.org/installer | php
and execute
php composer.phar self-update
php composer.phar update
use this if you can update to the last version.

Resources