404 error after updating PHP on Laravel project - php

I have a website made on Laravel 5.3 that was working fine under PHP 7.0
I found some errors on the site and after looking online for a solution, the unanimous cause was that the laravel and php versions are not compatible.
I then went to check my composer.json file and saw that the minimum version of php needed is 7.1 and up.
I told my hosting company to update PHP to 7.2 on my staging server and now when I try to access it, I get an error:
Oups ! Page not found !
(Error 404)
Error. Any idea if there's anything I need to do?
My Error Log:
https://wetransfer.com/downloads/a89f6b95d3ab9bf1b4a8f231250de96220190730104107/cef049

From the error log, by default the storage folder has root permission, change the ownership of the storage folder to apache, as the apache writes logs on the storage folder

Related

Laravel 5.8 error 500 uploaded in shared hosting cpanel

I uploaded a laravel-5.8 project to a shared hosting cpanel.
The problem is when I access index.php it gives me an error 500.
Here is my project directory
I didn't transfer the public folder yet. but it should work when access.
stage.example.com/public/ instead it displays error 500.
I changed the database credentials.
I haven't changed the path in index.php since I didn't move the public folder yet.
path:index.php
I tried putting phpinfo.php in the root folder to check the requirements for laravel 5.8 all of this was met, except for the PHP version, according to phpinfo, PHP version is 5.6. but when I checked under myphpadmin>web server the PHP version is 7.2.7.
PHP >= 7.1.3
BCMath PHP Extension
Ctype PHP Extension
JSON PHP Extension
Mbstring PHP Extension
OpenSSL PHP Extension
PDO PHP Extension
Tokenizer PHP Extension
XML PHP Extension
I hope someone can help I wanted to run my laravel5.8 project in Cpanel.
I have answered this question in another post. Have a look at it and see if helps:
What is the easiest and quickest method to deploy a Laravel web application live?
I tried putting phpinfo.php in the root folder to check the requirements for laravel 5.8 all of this was met, except for the PHP version, according to phpinfo, PHP version is 5.6. but when I checked under myphpadmin>web server the PHP version is 7.2.7
I have no idea what "myphpadmin" is, anyway since you're running PHP 5.6 Laravel can't work.
In cPanel you should have an option to select the PHP version, select the latest available, 7.3 if your cPanel is updated.
If you have blank page maybe you need to change the path to the autoload.php file in index.php. This file is in vendor folder.
Change :
require __DIR__.'/bootstrap/autoload.php';
by
require __DIR__.'/vendor/autoload.php';

TYPO3 v9 caching error with site-configuration.php-file?

I'm working on a new project in TYPO3. It's my frist installation of TYPO3 9.5.5 so I don't know if this is some sort of bug or anything but sometimes, and I really can't give you any more information about it since I dont know where it comes from and how to reproduce this error, my enire typo3 crashes with this error message:
(1/1) #1476107295 TYPO3\CMS\Core\Error\Exception
PHP Warning: rename(/var/www/html/var/cache/code/cache_core/5cab444370d80224649952.temp,/var/www/html/var/cache/code/cache_core/site-configuration.php): No such file or directory in /var/www/html/public/typo3/sysext/core/Classes/Cache/Backend/SimpleFileBackend.php line 234
Since it's in my var directory I figured to just delete the entire folder but as soon as I try to delete it Windows tells me I don't have permission to delete this file or even change it. When I try to open it in an editor it tells me that the file doesn't exist and I can't do anything about it unless I restart my entire PC.
I've found some people with the same issue here, but no way to fix it or anything on how to prevent it from happening.
I'm using the composer installation of TYPO3 with ddev on Windows 10.
Does anyone know about this error or can tell me anything on how to fix it?
Did you try to flush all TYPO3 caches?
To do so, go to Admin Tools => Maintenance => Flush TYPO3 and PHP Cache.
If the problem persists, you can try to got to Admin Tools => Environment => Directory Status and check if all permissions are set properly.
And since you run TYPO3 with ddev, you can use the shell (Putty or whatwever) and do a ddev ssh to login directly to the container and delete the files there.

EasyPHP starting error after trying to change PHP

I have been using EasyPHP-12.1 for some years now but, foolishly, tried to add a different version of PHP. (I had backed up the www files but not the whole installation). I added a new version (5.6.21) to the PHP folder, selected it in the admin but it didn't work. Now the server doesn't start. It comes up with the error:
Error in Apache configuration file: AH00526: Syntax error on line 185
of C:/Server/EasyPHP/apache/conf/httpd.conf: invalid command "PHPIniDir",
perhaps misspelled or defined by a module not included
in the server configuration.
I would like to go back to the original PHP (5.4.6) or, at least, reinstall the program and copy the MySQL databases to the new installation. As I said, I have copies of all the working php pages - it's the databases that I am worried about losing.
I hope someone can get me up and running again.
I seemed to have managed to get it all working again. I found an earlier dated backup in the conf folder, renamed it and restarted. Phew!
(Made sure I am backing up all the databases and EasyPHP folder now.)

Why do I not have any laravel error pages on my server?

I'm using Laravel 5.0. So when I was messing around with laravel on Vagrant it was really easy to debug because of the laravel error pages. Now that I've installed again on an actual apache server, I get no error pages.
I have forced a error by typing a variable that wasn't there and all I get is a WSOD with chrome telling me its a 500 error. I take that variable away and everything works fine, so I know whats causing my 500 error.
Edit: I have already changed 'debug' to true in my config/app file.
Any idea on how to get these error pages back?
When installing laravel on a server you must ensure that you set the correct permissions to the storage directory
sudo chmod o+w storage

Deploying Laravel Over FTP

I am working on deploying a Laravel app to a bluehost server and I am running into some trouble.
Currently, I uploaded all of the Laravel files to the root of the server, then uploaded the contents of the "public" folder to the "public_html" folder. From here I opened the "bootstrap/paths.php" file and changed the public path to
'public' => __DIR__.'/../public_html',
After this, I am still unable to get content to display. Am I missing something? It looks like bluehost is running PHP 5.4.24.
Any help with this would be appreciated.
Thanks!
EDIT: The error log shows
[09-Apr-2014 09:04:02] PHP Fatal error: require() [function.require]: Failed opening required 'DIR/../bootstrap/autoload.php' (include_path='.:/usr/lib64/php:/usr/share/pear') in /home1/regmuel/public_html/index.php on line 21
Could anyone help me figure this error out. I can clearly see what the problem is, I'm just not sure how to go about fixing it.
It looks like __DIR__ isn't getting parsed, are you sure your host isn't running PHP 5.2.* if you run phpinfo() on your host what version does it give?
__DIR__ is only available from PHP 5.3.0 onwards
RMcLeod's answer is perfect, just wanted to add to it something that I ran into with my web host (specifically Bluehost). Even after the version of PHP running on the server was 5.4.40 (found using php -v via an SSH terminal), I was running into the same problem where it was picking up an older version of PHP when interpreting my index.php and wouldn't recognize the DIR constant.
I had to add the line
AddHandler application/x-httpd-php54s .php
to the top of the .htaccess file which is in the same folder as my index.php
Just for context, I was trying to set up my laravel 4.2 app on bluehost and it relies heavily on this constant.

Categories