Laravel 5.5 not working with nginx and HHVM - php

Laravel is working fine with NGINX and PHP7 FCGI, but throwing an error 500 hphp_invoke when using NGINX with HHVM.
When running the command tail -n 50 -f /var/log/hhvm/error.log the output is:
Fatal error: syntax error, unexpected '(' in /var/www/apps/erp.com/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/LoadEnvironmentVariables.php on line 41
It is a fresh Laravel install and anything has not been changed.
I also tested hello world php scripts with NGINX and HHVM and they are working fine.
I am using ubuntu 16.04
Any help would be appreciated.

Related

Homestead vagrant up Parse error

I've been using Laravel 5.2 and recently started switching to Laravel 5.5. After configuring the etc/hosts and Homestead.yaml file, I encountered the following error:
Symfony \ Component \ Debug \ Exception \ FatalThrowableError (E_PARSE)
Parse error: syntax error, unexpected '?', expecting variable (T_VARIABLE)
As many have mentioned about PHP version problem, I thought once I have the homestead running, it should take care of it? As the doc said, in includesPHP 7.2
PHP 7.1
PHP 7.0
PHP 5.6 (doc). Moreover I have PHP 7.1.16 installed, which should meet the Laravel 5.5's requirement(PHP>=7.0.0). and the current configged php version is 7.0.8-2
I also updated virtual box to 5.2 and Vagrant to 2.1.1.
Also, when typing vagrant box list, I see this: laravel/homestead (virtualbox, 0.5.0)
Please help, thanks!!

Apache2 php parse error on server but not local machine, 7.2.3 to 7.2.4 issue?

I am deploying a laravel project to a droplet. I have everything seemingly set up correctly but I am getting the following error in the log when I go to the website:
PHP Parse error: syntax error, unexpected '?' in /var/www/public_html/studystation/vendor/symfony/http-foundation/Response.php on line 499
The line in question is as follows
public function getCharset(): ?string
php 7.2.3 was the version used in development. Checking with php -v the server is running 7.2.4. Could this difference be causing the parse error or could this be from improper setup? I'm also unsure how to go about setting up the older php 7.2.3 on the server to test the problem myself. I'm quite new to server setup and configuration.
I was facing the same issue and it was PHP version issue. I install the PHP 7.1 on the server and enable it by running this command
a2enmod php7.1 and php -v return 7.1 version but on browser by checking with phpinfo() function on a file it shows PHP 7.0.
I miss to disable the php7.0 and I did it by running:
a2dismod php7.0
and it did the trick.
P.S: You can use PHP versions which you installed, In my case I migrated from PHP 7.0 to 7.1

Laravel Project, 500 internal server error

I developed a simple application in laravel (5.6) everything works fine on my PC (windows 10/ Xamp / PHP 7.1). but when i upload the same project to a VPS running Cent OS it gives
with PHP 5.6 (which is expected)
Parse error: syntax error, unexpected '?' in /home/clarionit/public_html/ambience/c/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php on line 233
with PHP 7.0 / 7.1 / 7.2
500, Internal server error.
What I have done so far?
Permissions for all files and folders are set to 777 (to see if that is a problem)
Replacing index.php code with something simpler like phpinfo() works perfectly.
Ask for any more information needed, Please tell me what can be causing the 500, internal server error.
Laravel 5.6 requirement should be installed in system
PHP >= 7.1.3
OpenSSL PHP Extension
PDO PHP Extension
Mbstring PHP Extension
Tokenizer PHP Extension
XML PHP Extension
Ctype PHP Extension
JSON PHP Extension
Once run these commands, I hope your problem will resolve.
rm -rf vendor
rm -rf storage/framework/cache/*
rm -rf storage/framework/session/*
rm -rf storage/framework/views/*
rm composer.lock
composer clear-cache
composer install

How to run Laravel 5.4 from Apache localhost instead of artisan?

I am working on a web application project with Laravel 5.4.21, PHP 7 and Apache 2.4 on Windows 10.
When I run Laravel using 'php artisan serve' command, it runs fine. But if I run from apache htdocs, it shows following errors:
FatalThrowableError in Encrypter.php line 130: Call to undefined function openssl_decrypt()
But I have OpenSSL enabled in php.ini.
I do not have Xampp. I have searched some solutions, but they do not work.

How to deploy a Zend new project

I am currently trying to update a previous web site using Zend Framework.
As I dont want to work in a local network, I subscrided to a pro offer of OVH server.
So I put my old website in the www folder, I uploaded the Zend Framework directory (ZendFramework-1.11.11), and then created a foder dev in the root directory as well.
As I got this error when I try to create a new project with putty :
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in xxxx/ZendFramework-1.11.11/bin/zf.php on line 38
This seems to come because the serveur is running with php 4 instead of 5.
I created a .htaccess file including the following line :
SetEnv PHP_VER 5
When I use phpinfo(); in www/phpversion.php, it says it is PHP5. ...
But when I use php -v with putty, it keeps saying I am using php 4.4.9
Annyone has an idea to help me upgrading the server php version, and to help me creating my new project ??
Many thanks
Assuming you use a LAMP setup with debian as the operating system do this as root:
aptitude install libapache2-mod-php5 php5 php5-cli
and then retry. You may add some other packages like php5-gd or php5-suhosin etc.

Categories