laravel ErrorException can not create controller - laravel

[ErrorException]
file_put_contents(C:\xampp\htdocs\laravel\app/Http/Controllers/MyblogsController.php):
failed to open stream: No such file or directory.
when it ask for create controller this error is shown.i have composer installed and updated

Try running composer install on your project directory.
Also make sure you give write permission to the app/storage directory.
From documentation
Laravel may require one set of permissions to be configured: folders within app/storage require write access by the web server.

Related

composer laravel create-project windows 10 mkdir permission denied

I have just installed Laravel Homestead on my computer running Windows 10 and now I'm trying to create my first project with Composer.
I have cd:ed into the right folder called Code after doing vagrant ssh.
composer create-project laravel/laravel Project1 --prefer-dist
returns an error.
[ErrorException] mkdir(): Permission denied
Must be some kind of error with Composer permissions. How can I fix it?
In Windows 10 if you face some access problems you need to run the consoles and GIT BASH with Administrator rights only
In the "Homestead.yaml" file you can configure 777 permission via the following configuration.
"dmode=777" means all directory gets 777 permission and "fmode=777" means all file gets 777 permission on "code" folder.
folders:
- map: C:/Users/NEW/code
to: /home/vagrant/code
options:
mount_options: ["dmode=777","fmode=777"]
Ensure that the directory you are using is in the xampp folder. The error happens because you do not have write permission on your project folder. Check to ensure you are creating the project on the xampp folder because, regardless of you being the local admin, you may only have read permissions on some folders. You can right-click on the folder>properties>security tab on the users, click Add then add your username and assign them Full Control, click Apply. It may take some time to apply depending on the number of projects you have. After it finishes, you should be good.
PS: This is for Windows users and I sorted this out using the same process.
I solvet it temporarily with a solution that I'm not fully satisfied with, but at least it works.
sudo chmod 777 code-folder-name
Did this in the vagrant root folder.

Hosting with OpenShift RedHat get 500 errors when access the website

I have this website. The problem I have is
The freelancer-ngohungphuc.rhcloud.com page isn’t working
freelancer-ngohungphuc.rhcloud.com is currently unable to handle this
request.
500
I develop this website using Laravel 5.1. So what I have to do to fix this error.
Although you can usually check logs to see why you are getting a 500 error, it would appear that this is due to insufficient permissions - which need to be set on the storage and bootstrap/cache folders (as per the docs).
The folders both need to be writeable by your web server, so whilst 777 permissions will definitely work 775 should be fine (and more secure).
Doing this via a command line can be done with the following command (run it with sudo if you need to elevate to root permissions) chomd 777 -R storage bootstrap/cache or chomd 775 -R storage bootstrap/cache.
Doing this via an FTP client is doable, generally speaking you can just right click on the folder and choosing to edit permissions from there.
In some instances, vendor may need to be done too - from my experiences anyway.
These folders are all inside the root project directory for your Laravel application.
Edit
Excerpt from bottom of error log:
PHP Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE)
This would indicate that the PHP version you are running is not >= 5.5.9 (one of the Laravel requirements).
This is confirmed in the screenshot shown of the OpenShift configuration. The version of PHP needs to be updated for Laravel to work - this wasn't just a permission issue.

Persistent Permission Denied Error

I have seen a few posts on this (and tried the recommended solutions) but they are regarding Laravel 4 - And I am on Laravel 5.
For example;
'Failed to open stream: Permission denied' error - Laravel
I get the Command "dump-autoload" is not defined error and the reason for that is explained here;
http://laravel.io/forum/12-08-2014-command-dump-autoload-is-not-defined
In the above post, composer dump-autoload was suggested. I tried it, and again this morning the same error is back;
ErrorException in Filesystem.php line
74:file_put_contents(/vagrant/source/laravel- excel/storage/
framework/sessions/8338f386fc3de7bdc8d1b6dc7ee6790f71516d98): failed
to open stream: Permission denied`
Any suggestions?
Also, try the above comments and do a
composer self update
You Have to set the permission to Read & Write
In Mac We do this by using
**sudo chmod -R o+w storage**
Storage is the name of file U want to change permission
And currently my terminal is in the same folder where my storage folder is present therefore I did not specify its address

Error while creating migrations table with laravel: "No such file or directory"

When trying to run php artisan migrate:make create_users_table I get the following output in Windows CMD:
{"error":{"type":"ErrorException","message":"require(C:\...\\localhost
\\sites\\makeitsnappy\\app\/filters.php): failed to open stream: No such file or
directory","file":"C:\\...\localhost\\sites\\makeitsnappy\\app\\start
\\global.php","line":83}}
I'm running Windows 8. Laravel 4 and installed Composer, also ran composer update in the project folder. Same error happens.
Edit: Loading the application webpage, I get:
require(C:\.../localhost\sites\makeitsnappy\app/filters.php): failed to open stream: No such file or directory
Also, there is no filter.php file.
How can I fix this problem?
Since Laravel4 the routes and filters are in two different files: routes.php and filters.php not like in Laravel3 where both lay in the same file.
Check if there is a filter.php file in you app/ folder.
The error occurs because the autoloader tries to load this file on application's startup to get the filters for the called route or global filters.
Running composer update won't help here because you only get the framework and it's dependencies via composer and it doesn't update your app/ folder.
did you do composer install? It downloads some important files. I think you missed this command!
composer install

Failed opening required bootstrap/../vendor/autoload.php in an online script made with laravel

I just got a script from a friend and was written with the laravel framework. After uploading the script to my file manager, i am having this error
Warning: require(C:\xampp\htdocs\bin\bootstrap/../vendor/autoload.php): failed to open stream: No such file or directory in C:\xampp\htdocs\bin\bootstrap\autoload.php on line 17
Fatal error: require(): Failed opening required 'C:\xampp\htdocs\bin\bootstrap/../vendor/autoload.php' (include_path='\xampp\php\PEAR') in C:\xampp\htdocs\bin\bootstrap\autoload.php on line 17
From the error, i saw that the vendor folder was missing in my files and my friend also didnt have it.
I saw many articles talking about installing composer but i'm not having the laravel framework and the project is already on a web server.
Things i have tried.
I have copied other "vendor folder" from other laravel script i have, doesnt work.
I also tried installing composer on my pc and copied the vendor folder generated. still doesnt work
Please i will be very happy if anybody can help with this.
Thanks in advance.
IF you try upload your project to web hosting. follow this step.
compress whole project on your xampp/wampp/etc with zip extension
upload to your web hosting.
extract the file
create "Laravel" Directory
Move All Your File (your laravel Project) to "Laravel" Directory, EXCEPT "Public" directory.
open your "Public" directory, and move to public_html or parent directory or one step before your "Public" directory ("../")
edit your index.php (previously in "Public" Directory)
Edit this code
require DIR.'/../vendor/autoload.php';
$app = require_once DIR.'/../bootstrap/app.php';
to
require __DIR__.'/laravel/vendor/autoload.php';
$app = require_once __DIR__.'/laravel/bootstrap/app.php';
and don't forget update your database connection on your .env file :)
I have found a way of generating the folder and it works.
I install composer for windows on my system , then navigate to the htdocs folder in xamp where i kept the file. then run this command
--composer installer--
After some mins, it downloaded some files and generate the vendor file itself.
i then zip the folder and upload it to my web host
Thanks every one

Resources