what version of laravel are you using?
Upgrade php version
Hello,
My website : http://www.vitalami.advance-web-studio.com/
After I upgrade my php version from php 5 to php 7 turns into a blank white screen. What should I do ?
I upgrade it since I have another website in that same domain in order to make it works.
Laravel Framework 5.5.24
I have an .htaccess file in my public_html/vitalami.advance-web-studio.com
.htaccess
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews -Indexes
</IfModule>
RewriteEngine On
# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
# php -- BEGIN cPanel-generated handler, do not edit
# Set the “alt-php56” package as the default “PHP” programming language.
<IfModule mime_module>
AddType application/x-httpd-alt-php56___lsphp .php .php5 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit
# BEGIN cPanel-generated php ini directives, do not edit
# Manual editing of this file may result in unexpected behavior.
# To make changes to this file, use the cPanel MultiPHP INI Editor (Home >> Software >> MultiPHP INI Editor)
# For more information, read our documentation (https://go.cpanel.net/EA4ModifyINI)
<IfModule php5_module>
php_value date.timezone "Asia/Jakarta"
</IfModule>
# END cPanel-generated php ini directives, do not edit
I don't know what I did wrong.
Have you looked at your log files to see what errors are being thrown?
Warning: require(/home/advancew/public_html/vitalami.advance-web-studio.com../../framework_vitalami/vendor/autoload.php): failed to open stream: No such file or directory in /home/advancew/public_html/vitalami.advance-web-studio.com/index.php on line 24
I place line 24:
require DIR.'../../framework_vitalami/vendor/autoload.php';
in advancew/framework_vitalami/vendor/autoload.php
That's where the auto load is.
Why the error still exist?
I also get this error:
Warning: require(): It is not safe to rely on the system's timezone settings. You are required to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /home/advancew/framework_vitalami/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php on line 233
If I use this code:
require DIR.'/../../framework_vitalami/vendor/autoload.php';
Make sure that you have installed the correct version of php modules after upgrading to php 7
Install this:
sudo apt-get install php7.0-fpm
and restart the apache server
If error exists, install the respective modules:
php7.0-mbstring
php7.0-mcrypt
php7.0-zip
I change the .htaccess to this:
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews -Indexes
</IfModule>
RewriteEngine On
# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:% {HTTP:Authorization}]
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
# php -- BEGIN cPanel-generated handler, do not edit
# Set the “alt-php56” package as the default “PHP” programming language.
<IfModule mime_module>
AddType application/x-httpd-alt-php56___lsphp .php .php5 .phtml
sudo apt-get install php7.0-fpm
sudo apt-get install php7.0-mbstring
sudo apt-get install php7.0-mcrypt
sudo apt-get install php7.0-zip
</IfModule>
# php -- END cPanel-generated handler, do not edit
# BEGIN cPanel-generated php ini directives, do not edit
# Manual editing of this file may result in unexpected behavior.
# To make changes to this file, use the cPanel MultiPHP INI Editor (Home >> Software >> MultiPHP INI Editor)
# For more information, read our documentation (https://go.cpanel.net/EA4ModifyINI)
<IfModule php5_module>
php_value date.timezone "Asia/Jakarta"
</IfModule>
# END cPanel-generated php ini directives, do not edit
Now, I am getting this error:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator at [email protected] to inform them of the time this error occurred, and the actions you performed just before this error.
More information about this error may be available in the server error log.
Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.
I'm not really sure that .htaccess can use apt-get.
sudo apt-get install php7.0-fpm sudo apt-get install php7.0-mbstring sudo apt-get install php7.0-mcrypt sudo apt-get install php7.0-zip
If you are using CPanel there is possibility that your vendor directory got messed up when you updated.
If you have SSH access you might try to remove the vendor and run composer install again to get fresh copy of the framework.
Else check what CPanel gives you when installing laravel.
Are you using Cpanle to manage PHP versions? I know later versions allow to switch between PHP 5 and 7 via their UI.
As for your .htaccess file I'd personally try commenting out the line:
AddType application/x-httpd-alt-php56___lsphp .php .php5 .phtml
sudo apt-get install php7.0-fpm
sudo apt-get install php7.0-mbstring
sudo apt-get install php7.0-mcrypt
sudo apt-get install php7.0-zip
Don't add the above command in .htaccess file. You need to install the modules via terminal (Ubuntu).
And if you want to know the exact error, try running composer install in the root directory of laraval project. It will show you an error if any.
Please or to participate in this conversation.