Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

You have to enable opcache.load_comments=1 or zend_optimizerplus.load_comments=1. #103

Open
kjetilrong opened this issue Aug 27, 2016 · 8 comments

Comments

@kjetilrong
Copy link

when i try to use the command: php app/console doctrine:database:create

i get this error:
[Doctrine\Common\Annotations\AnnotationException]
You have to enable opcache.load_comments=1 or zend_optimizerplus.load_comments=1.

im using ubuntu 16.04 and i guess this is an php7 issue? How could i solve this.

@maxfierke
Copy link
Contributor

Yeah, the opcache may be setup on your machine to strip comments, which are needed because Doctrine stores some configuration in annotations in comments. You should just be able to add either of those lines to your php.ini to fix that issue.

@kjetilrong
Copy link
Author

those options is not applicable for php7. But to solve this problem i had to replace the Doctrine Annotations directory with a version found here: https://github.com/doctrine/annotations/releases/tag/v1.2.5.

Then i got i new error message.. Would Openskedge run on PHP7?

@kjetilrong
Copy link
Author

I got it running, had to edit the composer.json file.
trial an error brought me to this:
"php": ">=5.3.10,!=5.3.16",
"symfony/symfony": "2.5.",
"doctrine/data-fixtures": "1.0.
@dev",
"doctrine/doctrine-fixtures-bundle": "dev-master",
"doctrine/migrations": "dev-master",
"doctrine/doctrine-migrations-bundle": "dev-master",
"doctrine/orm": ">=2.5.0,<2.6-dev",
"doctrine/doctrine-bundle": "1.5.",
"twig/extensions": "1.0.
@dev",
"symfony/assetic-bundle": "2.3.",
"symfony/swiftmailer-bundle": "2.3.
",
"symfony/monolog-bundle": "2.3.",
"sensio/distribution-bundle": "2.3.
",
"sensio/framework-extra-bundle": "2.3.",
"sensio/generator-bundle": "2.3.
",
"jms/security-extra-bundle": "1.5.",
"jms/di-extra-bundle": "1.4.
",
"kriswallsmith/assetic": "1.1.@dev",
"pagerfanta/pagerfanta": "1.0.
",
"white-october/pagerfanta-bundle": "dev-master",
"symfony/proxy-manager-bridge": "2.3.*",
"symfony/icu": "1.1.

@kjetilrong
Copy link
Author

Strange.. every page works but one. The /app.php/users returns: The server returned a "500 Internal Server Error"
And i cant find anything in the error.log

@kjetilrong
Copy link
Author

Changed to "doctrine/orm": ">=2.4.0,<2.5-dev", in composer.json and the users page also loaded.

@Buhler24
Copy link

I am so glad to have found this discussion as I was also getting this error (and a headache from the brick wall). Thank-you for posting it publicly.

I tried several other suggestions for similar problems that I found elsewhere, but replacing the Doctrine Annotations solved this issue for me. It looks like most of the changes that you recommended for the composer.json file have been changed on the version I installed, but I still had to replace the Doctrine Annotations as you described above.

@tomarprashant
Copy link

can someone suggest what folder do i need to replace for Doctrine. I Downloaded the new Annotations folder from the above URL as per stedy6 Aug31.
So do i replace the entire /Openskedge/vendor/doctrine folder or /Openskedge/vendor/doctrine/annotations/lib ? can you please put the command here..i will really ..really appreciate.

@Serge928
Copy link

Serge928 commented Jun 7, 2018

/var/www/html/openskedge/vendor/doctrine/annotations for me, basically inside your openskedge folder then vendor ...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

5 participants