Laravel new command error - laravel

I did the following commands:
composer global require "laravel/installer=~1.1"
and
set PATH=%PATH%;%USERPROFILE%\AppData\Roaming\Composer\vendor\bin
But when I try to do:
laravel new blog
I get the following error:
Notice: Undefined variable: output in C:\Users\****\AooDara\Roaming\Composer\vendor\laravel\installer\src\NewCommand.php on line 55
Fatal error: Call to a member function writeln() on null in C:\Users\****\AooDara\Roaming\Composer\vendor\laravel\installer\src\NewCommand.php on line 55
Any idea of what went wrong?

Seems like you already have a directory called 'blog' in your application directory. Try creating a laravel app with different name or delete / rename existing 'blog' directory and try again.
for example laravel new helloapp.
However, I think the error showing at the console is a bug of laravel new command. I could see the error at the console when I tried to create a app with same name again from same directory.

The error not exists now. Try creating other application.

Related

Failed to open stream: No such file or directory using Laravel Forge

I'm using LiveWire for my Laravel project, and I'm trying to deploy using Laravel Forge but I encountered an Internal Server Error 500. I changed the .env to APP_DEBUG=true and APP_ENV=local.
Now I see the following error:
file_get_contents(/home/forge/officialmonte.co/vendor/livewire/livewire/src/../dist/manifest.json): Failed to open stream: No such file or directory (View: /home/forge/officialmonte.co/resources/views/layouts/app.blade.php) (View: /home/forge/officialmonte.co/resources/views/layouts/app.blade.php)
I thought the reason was because my project doesn't have a "dist" folder, and instead it named it as "build" folder. So I went to the file LivewireManager.php and changed the following code. My Project Folder
From this:
$manifest = json_decode(file_get_contents(__DIR__.'/../dist/manifest.json'), true);
$versionedFileName = $manifest['/livewire.js'];
To this:
$manifest = json_decode(file_get_contents(__DIR__.'/../build/manifest.json'), true);
$versionedFileName = $manifest['/livewire.js'];
But now I get this error instead:
file_get_contents(/home/forge/officialmonte.co/vendor/livewire/livewire/src/../build/manifest.json): Failed to open stream: No such file or directory (View: /home/forge/officialmonte.co/resources/views/layouts/app.blade.php) (View: /home/forge/officialmonte.co/resources/views/layouts/app.blade.php)
How can I solve this, and what is the error about? The thing that confuses me the most is that when I'm using my laptop to run the project (npm run dev), it works fine, but when I try to deploy, it breaks.

Creating new laravel project and this error came up

Creating new laravel project and this error came up
[ErrorException]
chdir(): No such file or directory (errno 2)
it means that your Laravel Application Can't Find the public folder.
I got it to work by
changing :
chdir($this->laravel->publicPath());
In:
vendor/laravel/framework/src/Illuminate/Foundation/Console/ServeCommand.php
To:
chdir('/');

using laravel 5.5 and get error to create my controller?

I am using laravel 5.5 and I get an error when I create my controller.
$ php artisan make:controller MyDatatablesController
I want to create new controller but I get this error:
[Symfony\Component\Debug\Exception\FatalThrowableError]
Parse error: syntax error, unexpected '=>' (T_DOUBLE_ARROW)
Your command is perfect their is some error in your project check your recent changes in your project
You're having an error on your own code. Probably it's a code not always executed. Try executing the command in verbose mode to have more information about the error
php artisan make:controller MyDatatablesController -vvv

LAMP Laravel ErrorException mcrypt_get_iv_size(): Module initialization failed

I installed laravel in my new pc and i'm getting this error:
ErrorException mcrypt_get_iv_size(): Module initialization failed
I copied the project from my old pc. mcrypt is installed and enabled, and other pages that do not use laravel are working. I'm running ubuntu 14.04
I created a new laravel project (using laravel new command) and when i try to access i get:
"Whoops, looks like something went wrong."
I opened the log and the error was:
production.ERROR: exception 'ErrorException' with message
'mcrypt_get_iv_size(): Module initialization failed
any ideas?
On app/config/app.php just change:
'cipher' => MCRYPT_RIJNDAEL_256,
Run php artisan key:generate on your command line to refresh your application key.
Then clear your cache and sessions and try again.
I had this same problem today, and it was because of how Laravel 4.2 uses the new encryption method.
Make sure you run php 7.0, and add this string "MCRYPT_RIJNDAEL_256" (without the quotes) to the cipher in app.php. after generate a new key (php artisan key:generate) and add the new key.
This works for me.
Another solution:
Add "tomgrohl/laravel4-php71-encrypter": "^1.1" to the require of your composer.json
Run composer update
Add 'AES-256-CBC' to the cipher in app/config/app.php
Done!

set_flashdata() triggers a fatal error in PyroCMS

I moved a Pyrocms site to another server.
Go to index: blank page.
Turn on errors: get this
A PHP Error was encountered
Severity: Notice
Message: Undefined property: Pages::$session
Filename: core/Model.php
Line Number: 50
Fatal error: Call to a member function set_flashdata() on a non-object in /var/www/vhosts/brokentalkers.com/httpdocs/system/pyrocms/modules/modules/models/module_m.php on line 193
If it sheds any light, I made a tar.gz of the contents of the old httpdocs folder, and extracted it in the new httpdocs folder.
I made a duplicate of the database with an identical user, so config/database.php shouldn't need changing.
Any ideas? Thanks in advance.
It seems like $session class is not initializing correctly.
Check for default_ci_sessions table, if you are using sessions for database.
Check if the constructor is loading sessions library.
Check if session is in autoload.php config

Resources