Hosting with OpenShift RedHat get 500 errors when access the website - laravel-5

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.

Related

Installing laravel on server

I am installing laravel on server via putty. I linked public with public_html. Files were located inside laravel folder above public_html. After installation its showing "Internal Server Error"
The server encountered an internal error or misconfiguration and was unable to complete your request.
Usually when using cPanel it will usually require your index.php to have the permissions 644 otherwise you'll get a 500 error.
You can change this in cPanel by doing the following:
Login to your cPanel (if not already there)
Click File Manager.
Click the name of the file for which you would like to change the
permissions.
Select the Change Permissions link at the top right of the page.
Select the permissions you would like to set for the file
Owner - Read and write
Group - Read
World - Read
Click Change Permissions.
Alternatively, if you have ssh access you could run the following command on the server:
chmod 644 path/to/index.php

Magento 500 Internal Server - No Log Files?

I have just upgraded my site from Magento 1.7 to 1.9 and i'm now getting a 500 Internal Server Error. From other posts, I have done the following:
Deleted the maintenance.flag file
Changed permission on index.php to 755
Changed permission on downloader/index.php to 755
Changed permissions recursively on /var to 777
I've also gone through the files and all directories seem to be 755 and all main files '666'.
I'm still getting the 500 Internal Server Error. The bigger problem is that I have no error files in /log to be able to identify the problem. I created the folder /log (because it didn't exist) but no files are in there. I do not have access to the frontend of backend (because of the 500 Internal Server Error) to make sure that logging is turned on.
Any idea how I can try to troubleshoot / get these error logs?
Thanks!
It sounds like you're getting a plain, un-styled 500 Internal Server Error page, which means its your web server that's returning the error. This means any error logging is likely to be in your web server log files, and not PHP or Magento's log files.
You'll need to check with your system administrator to find out
What web server you're running
Where it's log files are
And if you have access to those log files
Common places these files might be are
/var/log/apache2/error_log
/var/log/nginx/...
However, every distribution keeps them in a different place.

Laravel 5.3 Cannot Find File Error

I've setup a project more than a month ago and all of a sudden (this afternoon) I started getting the following error:
ErrorException in Filesystem.php line 111: file_put_contents(/var/www/html/project/api/storage/framework/cache/d8/00/d800874b5dc22b961e0ee92f8d1c5a09c24ee911): failed to open stream: No such file or directory
I've done research and tried the following with no success:
php artisan cache:clear
chmod -R 777 storage (I know this is not ideal)
composer update
Nothing is working. Before the chmod I was getting a permission error. I'm tapped out of ideas. Does anyone know what is causing this and how to resolve it?
You gave 777 to /storage folder but did you also make sure it's in same group as apache server is running?
Generally apache is in www-data group, add storage and bootstrap folder to be written by this group:
chgrp -R www-data /storage /bootstrap
Assign current user and group permission to read and write:
chmod -R ug+rw /storage /bootstrap
I'm 99% sure this will do it.
My server runs CentOS 7 and somehow Selinux was set to enforcing which breaks Laravel for some reason. I remember changing it when I first set up Laravel, but somehow it reverted back.
So setting it to permissive or disabled fixed it for me.
https://www.centos.org/docs/5/html/5.2/Deployment_Guide/sec-sel-enable-disable.html

Users and groups for NetBeans and Laravel 5

I'm trying to work with Laravel 5 on NetBeans.
Now, I'm trying to var_dump through Laravel 5 to understand how the application works, and I keep getting 500 errors when I have even a simple syntax error in my code, and it doesn't output the error log like normally. From what I understand by research is that it's caused by Laravel not being able to write into /storage/ folder in Laravel.
I created a new group netbeans and added www-data user to it, so right now I'm trying to figure out how do you install it so that Laravel 5 and NetBeans could 'recognize' each other. Right now I have NetBeans installed with apt-get install, and now that I've changed the Laravel 5 project rights with:
chown -R www-data:netbeans laravel5/
Now I can't access Laravel's project files with NetBeans because of right issues. All this is sort of confusing to me, so my question is:
How do I properly setup NetBeans and Laravel so I could edit my Laravel project folders files and somehow have Laravel access /storage/ folder inside Laravel, so I would not see 500 error and a blank page on every syntax error I make?
P.S: I tried to be as precise and explanatory as I could be
Check write permissions on storage folder!
Try:
sudo chmod -R 777 storage/
(i known that 777 is a bad thing to do, only do this to test).
After reading enter link description here it could also be a problem of permissions to write to the log folder. See the last comment from shiny

Laravel errors gone

enter code hereHi all my on windows 7(so i don't have any folder permissions) I have can't see Laravel error anymore. It worked fine yesterday.
why? what's wrong?
Laravel version 5.1 and web server wamp lastest version.
I found this link
but can't find file - storage/meta/compiled.php
this command also not working for me - php artisan optimize
also debug = true in .env and app.php files
please help
If you read the installation documentation you will find the following information:
After installing Laravel, you may need to configure some permissions. Directories within the storage and the bootstrap/cache directories should be writable by your web server. If you are using the Homestead virtual machine, these permissions should already be set.

Resources