PHP Fatal error when trying to install Cron in Laravel 4 - symfony

I am trying to install Cron with laravel 4. I followed these instructions:
http://packalyst.com/packages/package/liebig/cron#addjob
However I got stuck when trying to migrate the database using command:
php artisan migrate --package="liebig/cron"
And this is the error:
PHP Fatal error: Class 'Liebig\Cron\CronServiceProvider' not found in /var/www/domain.com/htdocs/SP/vendor/laravel/framework/src/Illuminate/Foundation/ProviderRepository.php on line 157
{"error":{"type":"Symfony\Component\Debug\Exception\FatalErrorException","message":"Class 'Liebig\Cron\CronServiceProvider' not found","file":"/var/www/domain.com/htdocs/SP/vendor/laravel/framework/src/Illuminate/Foundation/ProviderRepository.php","line":157}}
Yes, I have added Liebig\Cron\CronServiceProvider to providers in app.php
Any ideas? Thanks so much for your help.

Related

Cannot Composer Install with Symfony - PhpStorm

I had a problem with my Ubuntu so I needed to install back everything.
Nearly all is done but when I start a new project with Symfony on PhpStorm, and when I do a composer install or composer update in the terminal I have an error that I don't know how to treat.
Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache handling the symfony-scripts event terminated with an exception
[RuntimeException]
An error occurred when executing the "'cache:clear --no-warmup'" command:
PHP Fatal error: Uncaught Symfony\Component\Debug\Exception\ClassNotFoundException: Attempted to load class "DOMDocument" from the global namespace.
Did you forget a "use" statement? in /var/www/html/Eval2/vendor/symfony/symfony/src/Symfony/Component/Config/Util/XmlUtils.php:52
Stack trace:
#0 /var/www/html/Eval2/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php(284): Symfony\Component\Config\Util\XmlUtils::loadFile('/var/www/html/E...', Array)
#1 /var/www/html/Eval2/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php(41): Symfony\Component\DependencyInjection\Loader\XmlFileLoader->parseFileToDOM('/var/ww
w/html/E...')
#2 /var/www/html/Eval2/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php(57): Symfony\Component\DependencyInjection\Loader\XmlFileLoader->load('web.xm
l')
#3 /var/www/html/Eval2/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/MergeExtensionConfigurationPass.php in /var/www/html/Eval2/vendor/symfony/symfony/src/Symfony/Component/
Config/Util/XmlUtils.php on line 52
I tried installing composer following this link
but I don't recall using such practice.
So I cannot move forward with my project because I can't get past composer... if anyone knows why and could give me a step-by-step approach that would be truly appreciated.
Thank you
PHP's DOMDocument library is not installed. You need to install it. Try -
sudo apt-get install php-dom

error when I try to open app_dev.php file

I install symfony 2 under htdocs(xampp) folder, I start apache then I try to open app_dev.php file using this url :
http://localhost/symfony2/web/app_dev.php
I get this error :
Warning: require(C:\xampp\htdocs\symfony2\app/../vendor/autoload.php):
failed to open stream: No such file or directory in
C:\xampp\htdocs\symfony2\app\autoload.php on line 9
Fatal error: require(): Failed opening required
'C:\xampp\htdocs\symfony2\app/../vendor/autoload.php'
(include_path='C:\xampp\php\PEAR') in
C:\xampp\htdocs\symfony2\app\autoload.php on line 9
the tutorial that I follow (here) say that it will open a page
I reistall symfony using this command :
$ composer create-project symfony/framework-standard-edition my_project_name "2.7.*"
it works perfectly
Best way is to start symfony via the console to get the development enviroment:
bin/console server:run
http://symfony.com/doc/current/book/installation.html#running-the-symfony-application
Also check the read and write privileges, and check the composer installation.

Symfony2 Bootstrap.php.cache

I'm developing in Ubuntu 14 and I get the following error when creating a databaes:
$ php app/console doctrine:database:create
This is the error output:
PHP Warning: require_once(/home/jesse/playground/www/symfony/htdocs/app/bootstrap.php.cache):
failed to open stream: No such file or directory in
/home/jesse/playground/www/symfony/htdocs/app/console on line 10
PHP Fatal error: require_once(): Failed opening required
'/home/jesse/playground/www/symfony/htdocs/app/bootstrap.php.cache'
(include_path='.:/usr/share/php:/usr/share/pear') in
/home/jesse/playground/www/symfony/htdocs/app/console on line 10
What Ive Tried
Running this in Vagrant
Running this Locally
This is one among several problem running Symfony2 under Ubuntu, the other forcing you to implement umask(0000) otherwise you have to get chmod +a permissions for log and cache folders, this seems like a bit of a hassle for something seemingly simple.
Does anyone know what to work around this error?
This should do the trick:
php /home/jesse/playground/www/symfony/htdocs/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/bin/build_bootstrap.php

Laravel 4 : Running Migration on a VM and getting a mbstring / Symfony error

i am running a laravel project on a Puphpet VM set up (CentOS 6.4 Nginx) and all has been well but I created a new migration file and then went to run it
[code]php artisan migrate[/code]
Then got the following error message:
PHP Fatal error: Call to undefined function Symfony\Component\Console\mb_detect_encoding() in /vagrant/vendor/symfony/console/Symfony/Component/Console/Application.php on line 721
{"error":{"type":"Symfony\\Component\\Debug\\Exception\\FatalErrorException","message":"Call to undefined function Symfony\\Component\\Console\\mb_detect_encoding()","file":"\/vagrant\/vendor\/symfony\/console\/Symfony\/Component\/Console\/Application.php","line":721}}[/code]
Now looking around etc i see people refer to the mbstring needs to be installed etc but not sure how to go about this on a VM set up, and is this an update issue as i have managed ti run migration for a while on the VM but today nothing other than the error?
i have got access to the php.ini file and uncommented the following via Vim and set them both to pass, but nothing still even after a server restart.
mbstring.http_input = pass
mbstring.http_output = pass
Any advice appreciated.
As said i am using Puphpet/Vagrant using CentOS 6.4 with Nginx, on a MAC OSX 10.7 && 10.8 running PHP5.5
You should try to install mb_string, something like:
yum install php-mbstring
Then load the .so in your php configuration
I was facing the same error today. In my case the problem was that I had a separate php.ini for CLI, where the extension was not enabled.
After adding:
extension=php_mbstring.dll
to php_cli.ini everything worked fine.

stange error with Behat and Mink on Sf2

I'm using Behat,mink in my Symfony2 project,so I follow those tutorials to make installation :
http://extensions.behat.org/symfony2/ , http://extensions.behat.org/symfony2/migrating_from_2.3_to_2.4.html
but when I run this command php behat.phar --init "#YouBundleName",I get this very strange error :
PHP Warning: require(Behat\MinkExtension\Extension): failed to open stream: No such file or directory in phar:///var/www/project/behat.phar/src/Behat/Behat /Extension/ExtensionManager.php on line 112
PHP Fatal error: require(): Failed opening required 'Behat\MinkExtension\Extension' (include_path='.:/usr/share/php:/usr/share/pear') in phar:///var/www/project/behat.phar/src/Behat/Behat/Extension/ExtensionManager.php on line 112
I'm sure I installed the last version of behat and mink mentionned in the second link above and then I made php composer.phar unpdate and cache clear too,but still the same error?
I had the same problem. Forgot you need to install behat/mink-extension as well as behat/mink. For example you might need to run:
php composer.phar require behat/mink-extension:*
Worked for me.
By the way, looks like you got confused by the two installation methods, phar vs composer. I'd go with the composer route because it's easier to update and manage versions. This would mean running php bin/behat ... instead of php behat.phar ....

Resources