moving a symfony2 project to another PC - symfony

I developed a project using symfony2/PHP and now I am willing to shift this project to another machine how can I do the same
I tried following
1)I copied project folder to www folder of another machine
2)I edited app\config\parameters.yml on another system
but is not working its giving different erros
Can any one tell me exact staeps

Moving the source and the database should be enough. It is possible, you may have to clean cache.
php app/console cache:clear

Try clearing cache; open console / terminal and type php app/console cache:clear
Try chmod / chown or if you are on a windows machine, try change the owner, check permissions
Try re-run: php composer.phar update
Check your php-version and extensions. (See: http://symfony.com/doc/current/reference/requirements.html)

Cleaning the cache worked for me.
type php app/console cache:clear

Related

Symfony2 Sylius assets install

I am trying to install assets on my sylius project, and I am facing problem :
COMMAND: php app/console sylius:install:assets
ERROR AFTER EXECUTING COMMAND: This command terminated with a permission error
I found solution of a problem, before you guys try to install assets be sure to clear cache, but you might get into a trouble with memory, so edit your
app/console file and add ini_set('memory_limit','-1');
and after that run cache clear, and install assets and everything will be fine :)

Symfony in wamp error: Could not open input file: ⌠E:\wamp\bin\php\php5.5.12\symfony÷

I just installed symfony in my wamp according to the tutorials in below websites
http://uniapple.net/blog/?p=298
http://uniapple.net/blog/?p=298
all had finished without any error. But after finished all, when give the command symfony in cmd, it shows the below error.
Could not open input file: ⌠E:\wamp\bin\php\php5.5.12\symfony÷
and i couldn't figure it out. Please help..
Thank u in advance
If you are trying to use the Symfony console, you need to be in CMD and go to your project root:
cd C:\Sites\project
Before you try any commands, please make sure PHP is in your PATH variable.
Then to do commands in symfony you need to do:
php app/console command:action
//for example, do a cache warmup - choose your environment
php app/console cache:warmup --env=[dev|prod]
Is this what you mean when you want to use Symfony in cmd?

Cannot access Sylius admin or view styled login, register or account pages

I'm looking to use Sylius for a new e-commerce site and wanted to have a play around first as it looks awesome but after installing all seems to work well on the front end but as soon as I view the login or register page, any kind of template or styling is missing. In fact there are no stylesheets or Javascript files set. All that appears are the raw unstyled forms and literally nothing else.
If I try to log in using the credentials at the end of the app/console sylius:install step, I receive the following error:
"An exception has been thrown during the rendering of a template ("None of the chained routers were able to generate route: Route 'cmf_create_put_document_base' not found") in CmfCreateBundle::includejsfiles-create.html.twig at line 17.”
If I complete an order as a new customer and then view my account all I see printed to my screen is who I’m logged in as together with my username and email address and a logout link. That’s it.
Given I’ve had a play with the demo at http://demo.sylius.org/ this is not how I see it working.
If I grep the dev.log file, I find the following errors in addition to the one mentioned above:
[2014-12-11 10:07:29] assetic.ERROR: The template "CmfCreateBundle::includejsfiles-hallo-coffee.html.twig" contains an error: Unable to find file "#CmfCreateBundle/Resources/public/vendor/hallo/src/hallo.coffee". [] []
[2014-12-11 10:07:29] assetic.ERROR: The template "CmfCreateBundle::includejsfiles-ckeditor.html.twig" contains an error: Unable to find file "#CmfCreateBundle/Resources/public/vendor/ckeditor/ckeditor.js". [] []
If I look for the paths #CmfCreateBundle/Resources/public/vendor/hallo/src/hallo.coffee or #CmfCreateBundle/Resources/public/vendor/ckeditor/ckeditor.js I can verify they don’t exist in the vendor/symfony-cmf/create-bundle/Resources/public/vendor/ directory.
Install steps are:
composer create-project -s dev sylius/sylius-standard:v0.11.0 www, also tried composer
create-project -s dev sylius/sylius-standard www
cd www
chmod -R 775 web/media/ app/cache app/logs
chmod 664 app/configs/parameters.yml
composer run-script post-install-cmd as step 1 fails when trying to clear cache
app/console sylius:install with fixtures added
Of note, I’ve tried installing on VMWare (Ubuntu 12.04, PHP5.5) and an Amazon EC2 instance (Ubuntu 14.04, PHP5.6) and while I’m familiar with PHP and ZF2, I have zero Symfony 2 or Sylius experience.
Thanks in advance
I also just experienced this issue. To resolve it, simply add the following line to app/config/routing.yml:
symfony_cmf:
resource: #CmfCreateBundle/Resources/config/routing/rest_no_locale.xml
I'm investigating why the install didn't take care of this.
Although I couldn't get v0.11 working to get to the backend, installing v0.12, which was has just been released has resolved the issue. See more at http://sylius.org/blog/sylius-0-12-0-with-faceted-search.
Did you follow the steps here:
http://symfony.com/doc/current/cmf/bundles/create/introduction.html#installation
I followed #avolkman trick with adding a routing rule:
symfony_cmf:
resource: #CmfCreateBundle/Resources/config/routing/rest_no_locale.xml
But this only fixed problem with missing js files but not fixed problem with missing template on login page.
I'm using new version 0.12 (Sylius Standard) and still have this issue.
To solve the error :
php app/console cmf:create:init-hallo-devel
clear the cache or remove it as usual
php app/console ca:c --env=prod and php app/console ca:c
rebuild assets (you'll see now hallo-coffee.js)
php app/console assetic:dump --env=prod --no-debug
Done ! No more errors

symfony 2, demo not working on remote server

I created fresh symfony 2 app which includes AcmeDemoBundle. It works fine.
I commented out in app_dev.php so that it can be accessed from remote server (openshift cloud). On localhost it works without any problem. I git pushed to openshift, and app_dev.php worked as expected.
Then I moved demo routes to route.yml (for production).
On localhost app.php worked without any problem. So I git pushed to openshift but then app.php threw an error:
failed to open stream Acme/DemoBundle/Resources/views/Welcome/index.html.twig
So, I put back demo routes to routes_dev.yml, git pushed, but openshift error persists.
What might be the problem?
EDIT: The problem is that on my localhost path to twig template is "/var/www/html/jba/php/src/JBA/MainBundle/Resources/views/Default/index.html.twig" but on openshift it still looks to the same directory. But openshift dir layout is different, so it can't find the template. I guess I have to configure openshift to look at right directory. Just don't know how.
Have you cleared the cache for the prod environment?
php app/console cache:clear --env=prod
You might also have a look at the server logs/ the sf2 logs within app/logs/prod.log if this won't help.
I issued the following commands before uploading, but somehow cache seems to be not cleared yet.
php /var/www/html/jba/php/app/console cache:clear --env=prod --no-debug
php /var/www/html/jba/php/app/console cache:clear
Only deleting prod and dev directories under app/cache explicitly helped.
See also
Symfony2: access same route in production as development

Symfony2 Composer Install

I am trying to install Symfony 2.1.3 (latest). I am running composer and installs everything okay. The only error that I get is:
Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache
handling the post-install-cmd event terminated with an exception
[RuntimeException]
An error occurred when executing the "'cache:clear --no-warmup'" command.
It's being installed under www folder. I am running nginx and followed the composer approach. I read on internet that apache should be run manually not as a service, however I am using nginx instead. Does apache still have any bearing on it? I'm using debian squeeze.
Edit: As per AdrienBrault's suggestion the error was because the timezone was not set in the php.ini. Only with --verbose I could see the warning. Thanks guys.
Apache is not related - PHP is called via command line.
Most likely is the permission in the cache folder: did you check if the user that runs the composer update can actually write the cache folder?
Try to manually run rm -Rf app/cache/dev (for production environment replace dev with prod) and see if you get any permission error.
Also you will get this error if the default.timezone setting is not configured in php when running in CLI. To verify just run
php --info | grep timezone
and check that the setting date.timezone is correctly configured.
On the security side, setting 777 to the folder is not the optimal solution - if you have ACL enabled you could use that to correctly set up the permission for the cache and logs folder. Read more at the Symfony2 official installation page
I had this same issue for a while and after hours of face to brick wall pounding I realized... I have a .gitmodule in my project, and on initial checkout these submodules are NOT initialized and as such are not there for your composer to update, which results in the above error.
Make sure you run the following
git submodule update --init src/Acme/Sadness/Bundle
of course replace src/Acme/Sadness/Bundle with YOUR project namespace.
Hope this helps someone not go through the same pain I just did.
If you have vendor folder already I would remove it and install symfony 2.1.3 again via "composer.phar install". Problem might be coming from outdated version of composer
I had the same problem and I resolve in this way.
execute this on the console
and you should see something like this
$ locate php.ini
/etc/php5/apache2/php.ini
/etc/php5/cli/php.ini
/etc/php5/fpm/php.ini
the first line is probably your php.ini that appear when you do a phpinfo();
the problem is that when you execute composer update this no check the same php.ini
in my case the second line
all my sites work fine but always I had problems not now
after edit the second file and put the same time zone that you set in the first one
run
$ sudo service apache2 reload
and now
$ composer update
I hope that this work for you like work for me
regards
Emiliano

Resources