How to fix error: "Call to a member function listSpatialIndexes() on null" and why is it happening? - symfony

I have command:
php bin/console doctrine:schema:validate -e prod
When I run it, I'm getting error
"Call to a member function listSpatialIndexes() on null".
Please, help me by explain why it happens and how to fix it.
Additionally, the command "php bin/console doctrine:schema:validate -e dev", ends with the error
"[ERROR] The database schema is not in sync with the current mapping
file."

The problem was that variable server_version in pgsql in doctrine.yaml didn't exist. To resolve the problem, add
pgsql:
...
server_version: <insert your server version here, in my case 11.3>
You can see server's version by adding echo($this->getServerVersion()) and then exit(1) in the line 452 in vendor's file vendor\doctrine\dbal\lib\Doctrine\DBAL\Connection.php.

Related

Symfony 4 - php bin/console server:run not works

I have a problem with this command : php bin/console server:run on Symfony 4
When I go to http://127.0.0.1:8000/ I have this error message :
Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0
Fatal error: Unknown: Failed opening required 'J:\my_project\vendor\symfony\web-server-bundle/Resources/router.php' (include_path='.;C:\php\pear') in Unknown on line 0
Indeed, the router.php file does not exist !
But if I run this command : php -S 127.0.0.1:8000 -t public everything is ok.
Any idea ?
First check that you have installed the SF4 Web Server bundle :
> composer require server --dev
then you can start using it through Symfony using run / start command
Not sure if this is the case for you too, but it is probably worth checking (and may also be interesting for others having the same problem).
My antivirus software likes to put the router.php in quarantine (effectively removing it from that directory). Check if yours did the same and if so restore it and create an exception for that file. Additionally you should configure your antivirus to notify you if it puts something in quarantine, so you can intervene in time.

Assertion failure when using puphpet

I am trying to use the hhvm, but then i try and run my test script i get an 502 Bad Gateway (nginx) error message
so i tried to run it in terminal and i get the following error message:
$ hhvm /var/www/public/test.php
Assertion failure: /tmp/tmp.3Ty7dCXWJ2/hphp/runtime/base/rds.cpp:426: void HPHP::rds::initPersistentCache(): assertion `s_tc_fd != -1' failed.
Aborted
but when i run it using sudo it works!
$ sudo hhvm /var/www/public/test.php
hello world
What did i do wrong? i have tried updating the owner of a file and changed the permissions of hhvm, but this didn't work.
You shouldn't be getting assertion failures in a release build of HHVM. Can you please file an issue on GitHub so we can track the bug? Make sure to include your OS as well as the output of hhvm --version.

Please help me debug this error message I get at the console

When I run this command php app/console translation:update es GWDAdminBundle --force --prefix="__" at the terminal I get the following error message:
[Twig_Error_Syntax]
Unexpected token "name" of value "View" ("end of print statement" expected) at line 31
I don't which file is throwing this error, when I look at the log there is nothing remotely close to this, I suspect that it is one of my view files but how do I begin looking? Any ideas?
Many thanks to kix! I was able to debug all of my twig files with the following command:
php app/console twig:lint src/

Symfony console error

I have a symfony project. Whenever I run the build command using doctrine keyword I am getting the following error.
Task "doctrine" is ambiguous (doctrine:create-db, doctrine:clean).
Please do tell me, what I am getting this error and how can it be resolved
Somewhere you must executing
$ app/console doctrine
which causes this error. You have to explicitly run task(s), eg.
$ app/console doctrine:create-db
$ app/console doctrine:clean

json_encode work from command line but does't work with nginx

I have php5.5, nginx installed on Ubuntu 13.10 of Ec2.
My error relate to json_encode function :
PHP Fatal error: Call to undefined function json_encode()
After reading PHP Fatal error: Call to undefined function json_decode(), i install php5-json. As result, it works well when i call json_encode from command line.
But it doesn't work if i call json_encode from nginx server. I tried to add extension=json.so to the files /etc/php5/cli/php.ini and /etc/php5/fpm/php.init. But it can't resolve the problem.
Could you help me ?
Thank you in advance
Just to begin :
You uncomment
extension=json.so in
/usr/local/php5/etc/extensions.ini ?
And did you restart php5-fpm ?
Else, could you give us your phpinfos() ? (section json)

Resources