symfony2 locale and deployment - deployment

I am in the proces of creating a web application in symfony2. I have done all the development locally(OSX), but now I want to show a first version in a presentation where I can not use my own laptop.
I am deploying to an ubuntu 10 server. I also tested it on another small ubuntu 11 vps, but got the same problems.
I double checked with this tutorial whether php is set up correctly for symfony on my ubuntu server:
http://www.joelverhagen.com/blog/2011/05/how-to-configure-symfony-2-0-on-ubuntu-server-2011-4/
For deployment I followed these steps:
Moving app to production mode in Symfony 2
However the first step ( php app/console cache:clear --env=prod --no-debug ) gives me following error (this error also occurs when running this command locally):
php app/console cache:clear --env=prod --no-debug
Clearing the cache for the prod environment with debug false
[ReflectionException]
Class Packed\Bundle\UserBundle\Entity\Rapport does not exist
cache:clear [--no-warmup] [--no-optional-warmers]
Which is a bit weird since Packed\Bundle\UserBundle\Entity\Rapport does not exist, Packed\Bundle\ScoreModelBundle\Entity\Rapport however does.
since the app doe not need to go into production for some time this is not very urgent, what is very urgent is to get it running in development mode, so I tried using it through app_dev.php.
If I remove the localhost-check in app_dev.php everything works as expected but the i8n is not working... I can not switch to other locales as was possible locally:
xxx.com/app_dev.php/en
And it does not use the messages.nl.yml, messages.en.yml, ... and other files.
Any idea what might be causing this?
I checked the symfony and apache log but nothing weird there. Any other logs I should check?
Thanks!
Joris

Try to rebuild your bootstrap file. If you're using APC-cache restart it from cli. If it doesn't help.
Easiest way to do it is run composer and do the update.
To check the translations (the templates should be cached on the server) check the config.yml translator service must be enabled there. You may have it enabled in config_dev.yml but not in the config_prod.yml

Related

Sylius: "cache:clear" timeout

I've developed a sylius based site on a local server. I want to deploy it in production on my OVH server.
In the Sylius Sylius Cookbook, I did not find any particular procedure. So I followed the normal procedure.
Upload my code to the production server with a "git clone" of my git repository
Install my vendor dependencies "php composer install"But this step does not work because it never ends. At the end, I always have something like this:
Executing script cache:clear
[Symfony\Component\Process\Exception\ProcessTimedOutException]
The process "'/usr/local/php7.3/bin/php' '--php-ini=/usr/local/php7.3/etc/php.ini' './bin/console' --ansi cache:clear" exceeded the timeout of 20000 seconds.
I even tried "composer clearcache" before. It hasn't changed anything.
I am now trying "COMPOSER_PROCESS_TIMEOUT = 50,000". The "composer install" was sent 12 hours ago and is still not finished ...
Has anyone ever had this problem or know how to find a solution?
Is there a special step to do when working with sylius?
Because I really don't know what to do.
UPDATE:
My main lead at the moment is that the problem would come from sylius because I am trying to create a new install of sylius with the symfony 4 structure like this
composer create-project sylius/sylius-standard
Same result:
Executing script cache:clear
[Symfony\Component\Process\Exception\ProcessTimedOutException] The
process "'/usr/local/php7.3/bin/php'
'--php-ini=/usr/local/php7.3/etc/php.ini' './bin/console' --ansi
cache:clear" exceeded the timeout of 20000 seconds.
I tried to run composer create-project with the --no-scripts flag and run php bin/console cache:clear separately after that. The bug reappears with the second command.
You should first check that you are setting permissions right for your var folder, as per symfony install instructions.
You might also just be running out of resources on that server. Had the same issue on my last 1.7 project. The problem came from the cache:clear's warmup (probably because sylius has tons of dependencies and I added a bunch more). You might wanna try editing the composer.json "scripts" to:
"scripts": {
"auto-scripts": {
"cache:clear --no-warmup": "symfony-cmd",
"assets:install %PUBLIC_DIR%": "symfony-cmd"
},
Or, as you did per your update, run the install with the --no-script flag followed by bin/console cache:clear --no-warmup (do make sure you are installing the assets after that).
Cache will then be generated on your first visit to the website instead of being generated thru warmup.
This is a problem not just with the install, you'll have to use this workaround each time you wanna clear cache. My project is in production and working well using this, just gotta remember to visit the website once you did so that a random user doesn't have longer loading because the cache hasn't been generated yet.

Running mapbox-gl-js locally (unable to serve debug page)

Edit:
Summary, I tried to follow only the steps listed in the below two links as applies to windows:
https://github.com/mapbox/mapbox-gl-js/blob/master/CONTRIBUTING.md
https://github.com/stackgl/headless-gl#windows
Here I have reattached the screenshot of the commands that I had problems with:
https://imgur.com/RCQCNU5
One more step I took that I should mention is I also did not find the headless gl when I downloaded the repository, when the install headless gl command did not work I manually copied the file and put it in my local copy under the nodemodules directory thinking it would work but it didnt solve anything. I do think this is related to access issues but I dont know what else I should try to get it working?
First, let's clarify your problem: you want a version of mapbox-gl.js which contains a recently fixed bug.
Your best option is to just wait a couple of weeks for a release.
Failing that, you should build your own, from master. You don't need to set up a debug server for that. You can skip straight to the "Creating a Standalone Build" section.
If the steps for building on Windows don't work for some reason, you could set up a local virtual machine running Ubuntu and use that.
But honestly, just wait a couple of weeks. :)
Just in case some one else need to run this on local server.
After clone
Run npm install
npm run start-debug
It will start listening on port 9966.
Test the debug html files entering to
localhost:9966/debug/FILE_NAME_TO_TEST.html

How do I run mongo-express (without authentication)?

According to the official documentation for the web-based MongoDB admin interface mongo-express, one starts the tool using
cd YOUR_PATH/node_modules/mongo-express/ && node app.js
However, this does not seem to work. If I execute it on my system, I only get the "Usage" info console output. No error output. The same is true when using whatever combination of username / password / database parameters.
The mongod process works perfectly. Even the alternative tool mongomate (read-only) works fine on my system. I have created a simple test database, no authentication. All config settings on default.
Am I supposed to configure anything before using the application? I remember very clearly that I managed to get this to work very easily on another system some time ago, but now I just don't manage to get it started. Googling for "mongo-express" doesn't yield any helpful results either.
mongod db version is v3.2.0.
mongo-express version is 0.27.6.
OK, after reinstallation with the current version it worked again.
Current Version of mongo-express version is now 0.28.8.
Further investigation: After an experimental downgrade to the original version 0.27.6, it stopped working again, meaning that there was something wrong with that release. Upgrading to a newer version solved the issue.

laravel 5 ide autocompletion

I want to switch to laravel 5, but have some trouble with ide - autocompletion. I'm using phpstorm.
In google, the answers always end up with suggesting to use https://github.com/barryvdh/laravel-ide-helper . But it seems like it is broken for Laravel 5.
The steps I am doing are:
Install Laravel 5
composer create-project laravel/laravel
Require ide-helper
composer require barryvdh/laravel-ide-helper
Added 'Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider',
....
'Illuminate\Translation\TranslationServiceProvider',
'Illuminate\Validation\ValidationServiceProvider',
'Illuminate\View\ViewServiceProvider',
'Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider',
Trying to generate the helper file
artisan ide-helper:generate
But it always breaks with following error:
exception 'InvalidArgumentException' with message 'There are no commands defined in the "ide-helper" namespace.' in C:\xampp\htdocs\test\vendor\symfony\console\Symfony\Component\Console\Application.php:501
0 C:\xampp\htdocs\test\vendor\symfony\console\Symfony\Component\Console\Application.php(535): Symfony\Component\Console\Application->findNamespace('ide-helper')
1 C:\xampp\htdocs\test\vendor\symfony\console\Symfony\Component\Console
\Application.php(192): Symfony\Component\Console\Application->find('ide-helper:gene...')
2 C:\xampp\htdocs\test\vendor\symfony\console\Symfony\Component\Console\Application.php(126): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Outpu
t\ConsoleOutput))
3 C:\xampp\htdocs\test\vendor\laravel\framework\src\Illuminate\Foundation\Console\Kernel.php(91): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Out
put\ConsoleOutput))
4 C:\xampp\htdocs\test\artisan(36): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
5 {main}
Maybe someone had the same issue and can help me.
I'm open for different solutions for autocompletion other than barryvdh's ide-helper.
I had the same problem and this fixed it:
Before you run php artisan ide-helper:generate command, make sure to php artisan clear-compiled and php artisan optimize as it's noted here. If this didn't fixed your problem, take a look at this and clean out PhpStorm cache by choosing this:
File | Invalidate Caches/Restart
After auto restarting, PhpStorm will index again and everything should work fine.
Sorry for my bad english.
Edited: After these steps import your Facades like this use Illuminate\Support\Facades\Auth link them inside your _ide_helper.php file like use Auth.
I ran into the same problem. These are the steps I took to fix it:
I double-checked that 'Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider' was correctly added to the providers array in config/app.php.
I executed artisan clear-compiled. Had no effect
Executing php artisan config:clear fixed the problem.
This error occur when the package ServiceProvider isn't loaded.
If you have multiple config file (like for different environment), you must ensure that the service provider is well set in all the environment you which to use the package.
config/
local/
app.php
app.php
to verify if the service provider is correctly set to your application you can dump the app config:
dd(\Config::get('app.providers'));
Try this:
php artisan ide-helper:generate
Here is an updated gist as of this month. I have tested this and it works in PHPStorm.
Also you don't have to install this through composer. Copy the gist and save it in your root folder as _ide_helper.php.

Redmine plugin install (RedmineCRM Finance) results in 503

So my problem is that for some some reason installation of some plugins kills my bitnami redmine "permanently" (thin_redmine and thin_redmine2 stops after like 5 seconds).
The plugin which most recently did this is Finance Plugin from RedmineCRM. Version should be okay.
http://www.redmine.org/plugins/finance
Method I used (note that I added :migrate in the second line compared to their website (Is this the problem?)):
bundle install --without development test
bundle exec rake redmine:plugins:migrate NAME=redmine_finance RAILS_ENV=production
Am I missing or wrongly doing something? (Please note that I'm not really an expert in this field so I mainly go after how to-s.)
Are there anymore prerequirements for this (besides a very basic working redmine) e.g. I did not set up e-mail notifications, can stuff like this cause the problem?
Unfreez the gemfile. It solved the problem.