laravel 5 .. ubuntu .. command line - php

I am working using laravel5 php framework on ubuntu and I have 2 problems
1- when I try to use the composer to require anything .. it doesnt work
2- when i tried to make some changes to illuminate/Html .. it doesn't work too
so after that when i tried to use the artisan to serve my project I got that error
PHP Fatal error: Class 'Illuminate\Html\HtmlServiceProvider' not found in /home/shaimaa/Sites/Laravel5/eoswdt/storage/framework/compiled.php on line 5617
exception 'Symfony\Component\Debug\Exception\FatalErrorException' with message 'Class 'Illuminate\Html\HtmlServiceProvider' not found' in /home/shaimaa/Sites/Laravel5/eoswdt/storage/framework/compiled.php:5617
Stack trace:
#0 /home/shaimaa/Sites/Laravel5/eoswdt/storage/framework/compiled.php(1500): Illuminate\Foundation\Bootstrap\HandleExceptions->fatalExceptionFromError(Array)
#1 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->handleShutdown()
#2 {main}

Just run the following in your composer
composer require "illuminate/html":"5.0.*"
Inside your config/app.php add the following codes inside it
In the 'providers' => [ ..]
'Illuminate\Html\HtmlServiceProvider',
And in the
'aliases' => [ ..]
'Form'=> 'Illuminate\Html\FormFacade',
'HTML'=> 'Illuminate\Html\HtmlFacade',
And then refresh the page you should find that it should be working.

Related

PHP Fatal error: Uncaught Error: Class 'Adldap\Adldap\Configuration\DomainConfiguration'

Fatal error: Uncaught Error: Class 'Adldap\Adldap\Configuration\DomainConfiguration' not found in /var/www/html/accounts/ad/accounts.php:6 Stack trace: #0 /var/www/html/accounts/ad.php(15): include() #1 /var/www/html/accounts/index.php(72): include('/var/www/html/a...') #2 {main} thrown in /var/www/html/accounts/ad/accounts.php on line 6
accounts.php =
<?php
require_once __DIR__.'/../../vendor/autoload.php';
use Adldap\Adldap;
use Adldap\Utilities;
$config = new Adlap\Configuration\DomainConfiguration([
'hosts' => [
'XXXXXXXXXX',
],
]);
$ad = new \Adldap\Adldap();
$ad->addProvider($config);
try {
$provider = $ad->connect();
Make sure is exits Adldap\Adldap php package also for this you need install composer tool. . If it doesn't exits then add name of package to composer.json like this:
composer require vendor/package
For show installed packages enter:
composer show -i
After it you can use package easly.

How to move dependency out of vendor in symfony 3?

I have "inherited" a project that has a git dependency I do not have access to. I have the contents of the whole /vendor directory and want to move the dependency out of it so that I do not need to commit the whole /vendor directory to git. I have moved the directory with the dependency to /my-vendor directory (at the same level as vendor), but have no idea how to include it into the project.
When running composer install I get:
[RuntimeException]
An error occurred when executing the "'cache:clear --no-warmup'" command:
Fatal error: Uncaught Symfony\Component\Debug\Exception\ClassNotFoundException: Attempted to load class "MY_BUNDLE_CLASS" from namespace "DEP_NAME\MY_BUNDLE".
Did you forget a "use" statement for another namespace? in /app/app/AppKernel.php:40
Stack trace:
#0 /app/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php(406): AppKernel->registerBundles()
#1 /app/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php(113): Symfony\Component\HttpKernel\Kernel->initializeBundles()
#2 /app/app/AppKernel.php(21): Symfony\Component\HttpKernel\Kernel->boot()
#3 /app/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php(137): AppKernel->boot()
#4 /app/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php(124): Symfony\Bundle\FrameworkBundle\Console\Application->registerCommands()
#5 /app/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php(89): Symfony\Bundle\FrameworkBundle\Console\Application->add(Object(Symfony\Component\Console in /app/app/AppKernel.
php on line 40
MY_BUNDLE_CLASS, DEP_NAME, and MY_BUNDLE being edited.
You can place those bundles in bundle directory, for example, and then add to composer.json following lines:
"repositories": [
{
"type" : "path",
"url" : "./bundles/your-bundle"
}
]

Error clearing cache / composer install - SensioFrameworkExtraBundle not found in kernel.php line 33

I face an issue since last Friday. Everything was working fine on my project and then friday when deploying:
after
$> php bin/console cache:clear
My Symfony project doesn't work anymore. I got this error:
Fatal error: Uncaught Symfony\Component\Debug\Exception\ClassNotFoundException: Attempted to load class "SensioFrameworkExtraBundle" from namespace "Sensio\Bundle\FrameworkExtraBundle".
Did you forget a "use" statement for another namespace? in /Users/dam/Development/Alara/rayflex/git/rayborn/src/Kernel.php:33
Stack trace:
#0 /Users/dam/Development/Alara/rayflex/git/rayborn/vendor/symfony/http-kernel/Kernel.php(492): App\Kernel->registerBundles()
#1 /Users/dam/Development/Alara/rayflex/git/rayborn/vendor/symfony/http-kernel/Kernel.php(132): Symfony\Component\HttpKernel\Kernel->initializeBundles()
#2 /Users/dam/Development/Alara/rayflex/git/rayborn/vendor/symfony/framework-bundle/Console/Application.php(64): Symfony\Component\HttpKernel\Kernel->boot()
#3 /Users/dam/Development/Alara/rayflex/git/rayborn/vendor/symfony/console/Application.php(148): Symfony\Bundle\FrameworkBundle\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#4 /Users/dam/ in /Users/dam/Development/Alara/rayflex/git/rayborn/src/Kernel.php on line 33
I tried to delete my vendor and reinstall same error
I tried a composer selfupdate && composer update
I Also tried to put the use in kernel.php...
Still nothing
I took an old tag of my project who was working fine Some month back. Same error..
I have Fix my problem on reinstalling SenSio Bundle
$ composer require sensio/framework-extra-bundle
I can't explain why, it was already installed and in the composer.json before ..
Thank for your help !

Error after run "php artisan config:cache"

After run php artisan config:cache , show error in
Fatal error: Uncaught ReflectionException: Class config does not exist
in
D:\xampp\htdocs\app\vendor\laravel\framework\src\Illuminate\Container\Container.php:729
Stack trace: #0
D:\xampp\htdocs\app\vendor\laravel\framework\src\Illuminate\Container\Container.php(729):
ReflectionClass->__construct('config') #1
D:\xampp\htdocs\app\vendor\laravel\framework\src\Illuminate\Container\Container.php(608):
Illuminate\Container\Container->build('config') #2
D:\xampp\htdocs\app\vendor\laravel\framework\src\Illuminate\Container\Container.php(575):
Illuminate\Container\Container->resolve('config') #3
D:\xampp\htdocs\app\vendor\laravel\framework\src\Illuminate\Foundation\Application.php(728):
Illuminate\Container\Container->make('config') #4
D:\xampp\htdocs\app\vendor\laravel\framework\src\Illuminate\Foundation\helpers.php(106):
Illuminate\Foundation\Application->make('config') #5
D:\xampp\htdocs\app\vendor\laravel\framework\src\Illuminate\Foundation\helpers.php(269):
app('config') #6 D:\xampp\htdocs\app\vendor\laravel\framework\src\Ill
in
D:\xampp\htdocs\app\vendor\laravel\framework\src\Illuminate\Container\Container.php
on line 729
I add this Code On bootstrap/app.php
$app->bootstrapWith([
\Illuminate\Foundation\Bootstrap\LoadEnvironmentVariables::class,
\Illuminate\Foundation\Bootstrap\LoadConfiguration::class,
\Illuminate\Foundation\Bootstrap\HandleExceptions::class,
\Illuminate\Foundation\Bootstrap\RegisterFacades::class,
\Illuminate\Foundation\Bootstrap\SetRequestForConsole::class,
\Illuminate\Foundation\Bootstrap\RegisterProviders::class,
\Illuminate\Foundation\Bootstrap\BootProviders::class,
]);
new Error after added this code :
And run composer dumpautoload -o, it doesn't work
I added this code , it works
$app->bootstrapWith([
\Illuminate\Foundation\Bootstrap\LoadEnvironmentVariables::class,
\Illuminate\Foundation\Bootstrap\LoadConfiguration::class,
\Illuminate\Foundation\Bootstrap\HandleExceptions::class,
\Illuminate\Foundation\Bootstrap\RegisterFacades::class,
\Illuminate\Foundation\Bootstrap\SetRequestForConsole::class,
\Illuminate\Foundation\Bootstrap\RegisterProviders::class,
\Illuminate\Foundation\Bootstrap\BootProviders::class,
]);
but i use sluggable package and set method to config file , after set command , change sluggable package method array to this :
'method' =>
Closure::__set_state(array(
)),
Now , my app doesn't work!
Because comment this code and work my code ! :(

laravel not class found in deployment server

I have a Laravel 4 application working fine on my local machine. I've cloned it onto my VPS. When I run composer install or composer update, I get errors that "class not found". I've checked vendor/composer/autoload_classmap.php and my classes are there. The class is located in the standard app/models/. I removed some code, which finally allowed the composer to update. However none of my custom classes all located inside app/models are being loaded. Any ideas what's going on? Thanks.
Local: php version 5.5.10
VPS: php version 5.5.9
Edit: Included error log
[2014-10-23 02:50:37] production.ERROR: exception 'Symfony\Component\Debug\Exception\FatalErrorException' with message 'Class 'Role' not found' in ../app/routes.php:214
Stack trace:
#0 [internal function]: Illuminate\Exception\Handler->handleShutdown()
#1 {main} [] []
Role.php is located in app/models/
Edit2: Added route
Route::group(array('before' => 'auth.admin'), function() {
$roles = new Role();
Route::get('/help', array(
'as' => 'help',
'uses' => 'HelpController#getHelp'
));
}
This isn't the full route, but that's essential it. Everything works fine on local machine also.
I found the problem with the help of others. MY VPS did not support short tags. My Role.php began with <?. I corrected it with <?php and everything works.

Categories