This is a strange one, I have never come across it before - but then I've not used Symfony 3.1, only 2.8.
When I run a console command such as clear:cache or a doctrine:schema:update, I get the following error on terminal:
PHP Parse error: syntax error, unexpected '[', expecting ')' in
/var/www/vhosts/mycrmsitetest.co.uk/httpdocs/bin/console on line 20
The line its referring to in the console file is:
$env = $input->getParameterOption(['--env', '-e'], getenv('SYMFONY_ENV') ?: 'dev');
This is exactly the same as on my local drive, but it works there - it's only when it's on the server that this fails.
Does anyone know what this may be?
You need PHP version greater then 5.4. Your script contains the new array syntax ('[]' instead of 'array()'): http://php.net/manual/en/migration54.new-features.php
Related
I am trying to decode a bunch of .ZST files which I do not know what the original file was so I can access them, however all of the .ZSTs return the exact same error and do not get decompressed. The error is Decoding error (36) : Dictionary mismatch. The command used is zstd -d * on Windows 10 x64 using ZSTD v1.4.4 for Win x64.
I have already tried CMD, PowerShell and Bash as different environments to run the command but all return the exact same error. I have tried decompressing a single individual file to see if it was a bulk-operation issue but it didn't work either. My last attempt was to Google for the error but I could not find anything.
Edit: After investigating a little further, I decided to try checking for the MIME types of my ZST files, some of them get returned as application/x-zstd while others get returned as application/octet-stream. I wonder if this could be the issue? Although neither MIME types work, both return the same error.
Does anyone know how I could fix this error and get to decompress my files?
Here is one of the ZST files for reference: https://mega.nz/#!eV0VTKBQ!WBW_pVIq8Tsn2Rrv3XKmt4DSAH7IHbHtaAuNB9uRTMQ
I use composer require mpdf/mpdf to install it.
when trying example I got error:
Parse error: syntax error, unexpected '.', expecting '&' or variable
(T_VARIABLE) in /var/www/randomizer/library/mpdf/src/functions-dev.php
on line 4
hope someone can help me with this issue.
Ensure you are running PHP5.6 or higher when attempting to run the examples. Your CLI might be a different version which is why it didn't complain when you installed Mpdf via composer.
My application generates a PDF file from a webpage using WKHTMLTOPDF tool. Application written with Symfony2 framework and I am using a Symfony2 process to run the shell command to call WKHTMLTOPDF. My command is like below.
C:\wkhtmltopdf\wkhtmltopdf.exe --lowquality --margin-bottom '0' --margin-left '0' --margin-right '0' --margin-top '0' SOURCE.html SOURCE.pdf
This gives me an error now.
Invalid argument(s) parsed to --margin-bottom
is the error I am getting. I am really confused because for some cases it is working perfectly. Only some cases it is not working.
When I try to run the same command in the CMD, it works. Only symfony process gives error.
I really appreciate if anyone can help me.
I am struggling with running new asp.net 5 on my qnap box. As far as I understand it is a strongly modified version of debian.
As part of running installation script I got this error:
-sh: /root/.dnx/dnvm/dnvm.sh: line 616: syntax error near unexpected token `<'
-sh: /root/.dnx/dnvm/dnvm.sh: line 616: read versionOrAlias downloadUrl < <(__dnvm_find_latest "$runtime" "$arch" "$os")'
I run my script bu using script command like:
script /root/.dnx/dnvm/dnvm.sh
as stated in documentation and previous installation script.
By commenting this line out I was able to run whole script but obviously dnvm command does not work properly.
My question is:
What does it do (line with < < syntax) and how do I fix it or rewrite so that my qnap box unix can understand it.
<(...) is Process substitution. /bin/sh doesn't support it, but /bin/bash does. Try changing the shell.
I tried following the SauceLabs PHP tutorial: https://docs.saucelabs.com/tutorials/php/
I tried to make it run on Windows. So I followed every step until I have to run this command:
vendor\bin\phpunit.bat WebDriverDemo.php
This generates an error: Parse error: syntax error, unexpected T_USE, expecting T_FUNCTION in C:\xampp\htdocs\sauce-tutorial\vendor\sauce\sausage\src\Sauce\Sausage\WebDriverTestCase.php
on line 6
So I tried looking at WebDriverTestCase.php on line 6 and this is the code:
namespace Sauce\Sausage;
abstract class WebDriverTestCase extends \PHPUnit_Extensions_Selenium2TestCase
{
use TestCase; // this is line 6
}
Whats wrong with this code? I changed nothing, I only tried to run what the tutorial suggests. Any ideas?
I don't use PHP but on the basis of what I found with a Google search, I'd suggest making sure you are running the code with PHP 5.4 or later. In the cases I found on the web using an older version of PHP seemed to be the cause of that error.