Laravel 5.4 with PHP 7.3, getting PDO unexpected? - php

(1/1) FatalThrowableError
Parse error: syntax error, unexpected '?', expecting variable (T_VARIABLE)
I have a Laravel 5.4 application, I had to move servers to a server with PHP 7.3. PDO is giving the above error. I worked in Php 7.2.7.
best I can see is this line generates the error
at Connection->Illuminate\Database\{closure}('select count(*) as aggregate from `users` where `email` = ?', array('email#server.fi'))
I am not sure what else would be helpful, did something change between 7.2 and 7.3 to cause such an error

Related

Laravel 7: Installing od FTP Server

I installed Laravel 7 on my FTP server, but I get this message
Parse error: syntax error, unexpected ':', expecting '{' in /vendor/symfony/polyfill-php80/bootstrap.php on line 23
When I used localhost everything was fine. What is wrong?
Laravel 7 require PHP >= 7.2.5. Check version installed on server.

Program-O Server Error

Today I installed Program-O 2.6.8 on a colocation server with x86_64-redhat-linux-gnu, running Apache, PHP 5.3.3, MySQL 5.6.38, PDO and cURL are enabled.
After uploading some AIML files I tried the JSON interface and received an error:
"Something went wrong! Error = Internal Server Error"
I include the log entries and hope someone can tell me what is wrong.
Thanks
Program O has encountered an error. this may help:
Error # 1024
Message: Test error
File: /var/www/vhosts/xxxxxx/webspace/httpdocs/xxxxxx/programo/admin/validateAIML.php, line 21
Program O has encountered an error. this may help:
Error # 8
Message: session_start(): ps_files_cleanup_dir: opendir(/var/lib/php/session) failed: Permission denied (13)
File: /var/www/vhosts/xxxxxx/webspace/httpdocs/xxxxxx/programo/admin/index.php, line 53
[31-Jan-2018 19:39:47] PHP Parse error: syntax error, unexpected '[' in /var/www/vhosts/xxxxxx/webspace/httpdocs/xxxxxx/programo/chatbot/core/conversation/intialise_conversation.php on line 449
PHP 5.3 does not support short array notation, that was brought in in PHP 5.4
Which will cause this issue:
[31-Jan-2018 19:39:47] PHP Parse error: syntax error, unexpected '['
in
/var/www/vhosts/xxxxxx/webspace/httpdocs/xxxxxx/programo/chatbot/core/conversation/intialise_conversation.php
on line 449
TL;DR: It clearly states on the docs for system-requirements: https://github.com/Program-O/Program-O#system-requirements
Program O requires PHP version 5.3.0 or higher to function.
That means 5.4+ not 5.3.3.

Parse error: syntax error, unexpected '?' in /vendor/laravel/framework/src/Illuminate/Foundation/helpers.php on line 233 - laravel

I have a subdomain folder running on php 7. Globally my php version is 5.6 actually. When i run my project, i get a 500 internal error. Checking my error_log, i see this error
Fatal error: Call to undefined function Symfony\Polyfill\Mbstring\iconv_strpos() in /home/invoice/vendor/symfony/polyfill-mbstring/Mbstring.php on line 358
I tried to install this command composer require symfony/polyfill-icon in my subfolder (under the subdomain which is running on php 7) but then this is the result in the terminal
Warning: Ambiguous class resolution, "App\Http\Controllers\Auth\RegisterController" was found in both "/home/laravel/public_html/myproject/app/Http/Controllers/mNotify/Auth/RegisterController.php" and "/home/laravel/public_html/myproject/app/Http/Controllers/Auth/RegisterController.php", the first will be used.
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
Parse error: syntax error, unexpected '?' in /home/laravel/public_html/myproject/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php on line 233
When i look in the vendor file in my subfolder under the subdomain, the
Symfony\Polyfill\Mbstring\iconv is installed there but when i test from the terminal using php --ir iconv, it get Extension iconv is not present.
What is happening?
check if mod php < 7.0 has enabled to disabled it.
and enable mod php 7 or 7.1

Symfony2 - php app/console getting a parse error on a HostGator shared host

I've followed the steps to deploying the site remotely, but when I attempt to run php app/console inside the symfony folder I'm getting the following:
Parse error: syntax error, unexpected T_STRING, expecting T_CONSTANT_ENCAPSED_STRING or '(' in /home4/username/symfony_project/app/console on line 13
Is there is an option I missed when deploying?
Nvm, figured it out need to use '/opt/php55/php' instead of 'php'.
e.g., /opt/php55/bin/php app/console

Symfony 2 and gits : How do i install that vendors library ?? I got errors

I'm trying to set up a Symfony dev platform on webfactionnal.
I'm using Git so when I download S2 I took th "without vendors" version and followed those instructions.
So everything went fine until step 8 :$ php bin/vendors install
I got several error messages when trying to execute this line on my server :
Warning: Wrong parameter count for parse_ini_file() in /home/quantum/webapps/quantumnetworks/bin/vendors on line 74
Warning: Invalid argument supplied for foreach() in
/home/quantum/webapps/quantumnetworks/bin/vendors on line 79 sh:
./vendor/bundles/Sensio/Bundle/DistributionBundle/Resources/bin/build_bootstrap.php:
No such file or directory
Parse error: syntax error, unexpected T_STRING, expecting
T_CONSTANT_ENCAPSED_STRING or '(' in
/home/quantum/webapps/quantumnetworks/app/console on line 13
Parse error: syntax error, unexpected T_STRING, expecting
all the files are originals.
By the way, in the the /config.php I had that error : unable to read logs file, I've put it on 777 on my server and realize that it was named as log instead of logs ... why ?
Thanks !
T_CONSTANT_ENCAPSED_STRING or '(' in
/home/quantum/webapps/quantumnetworks/app/console on line 13
EDIT : I run php54 command to use php 5.4 as my hosting company advised me. But i still have some errors ,It download evrything, then i have
Installing/Updating AsseticBundle
and then come the error :
Receiving objects: 100% (1918/1918), 251.85 KiB | 447 KiB/s, done.
Resolving deltas: 100% (1164/1164), done.
61c9f363e73b4ecbb72f81eb62675260a1132048 HEAD is now at 41b5913 Merge
pull request #27 from stof/disable_profiler
Parse error: syntax error, unexpected T_STRING, expecting
T_CONSTANT_ENCAPSED_STRING or '(' in
/home/quantum/webapps/quantumnetworks/vendor/bundles/Sensio/Bundle/DistributionBundle/Resources/bin/build_bootstrap.php
on line 35
Parse error: syntax error, unexpected T_STRING, expecting
T_CONSTANT_ENCAPSED_STRING or '(' in
/home/quantum/webapps/quantumnetworks/app/console on line 13
Parse error: syntax error, unexpected T_STRING, expecting
T_CONSTANT_ENCAPSED_STRING or '(' in
/home/quantum/webapps/quantumnetworks/app/console on line 13
So yeah were making progress, almost done :)
EDIT2 :
I called my host company, they said , when you execute a script in php, even if you type php54, the script itself, if it starts another script, won't call it with the 5.4 version. TO fix that, here are the 4 steps :
cd ~/webapps<your application>
ln -s /usr/local/bin/php54 ./php
export PATH=./:$PATH
php54 bin/vendors install
need to do all of them
You are not using php 5.3, which is required to run Symfony2.
You can check on the console via
php -v
which version you currently use.
The T_CONSTANT_ENCAPSED_STRING or '(' in [...] is usually a hint, as php prior to 5.3 does not support Namespaces, which leads to syntax errors in older versions.

Categories