I recently installed APC extensions for my default PHP installation. To facilitate the loading of this new extension I created a new php.ini in /private/etc/

So now this location contains both the new php.ini and the default, php.ini.default. The new php.ini is just a copy of the default one but with the added extension being loading in the dynamic extensions section.

When I attempt to access any page in my local/host/~username virtual directory I receive a server 500 error.

I viewed the logs located in /var/log/apache2/ but I don't see any log of a server 500 error.

I suspect that this error might be related to my having both the default and the new php.ini in the same directory.

Has anyone had this problem? Should I remove / rename the default configuration file?

This is the line that I added to the Dynamic Extensions section of php.ini

vim extension=/usr/lib/php/extensions/no-debug-non-zts-20090626/apc.so

  • What did you do to make Apache use the right php.ini file? Do you have xcache installed? Please post your Apache configuration file? – quanta Aug 23 '11 at 6:29
  1. Run ls /usr/lib/php/extensions/no-debug-non-zts-20090626/apc.so. Is the extension binary there? If not, make sure it's properly installed.
  2. The added line should probably be just extension=apc.so.
  3. If it still doesn't work, make sure extension_dir=/usr/lib/php/extensions/no-debug-non-zts-20090626 is in your php.ini.

Best of luck!

| improve this answer | |
  • Thank you for the reply. I changed the my extension inclusion line to just be extension=apc.so I found a commented out line that said extension_dir = "./" I uncommented this line and changed the path to match the path to the folder containing my extension. No beans. I commented out the extension=apc.so line though and it works. So it it definitely the extension that is blowing me up. – Nick Aug 23 '11 at 3:48
  • 1) Wrong build (built for different PHP version, thread-safe/non-thread-safe, x32 / x64 bit) ? 2) Wrong APC configuration (how did you configured it)? – LazyOne Aug 23 '11 at 10:55
  • @LazyOne excuse my ignorance. I am new to PHP configuration. I compiled the extension and then just added the extension to the dynamic extension section of my php.ini. I was using some instructions I found online. Is there more configuration that needs to be done to the extension outside of just adding the extension to the php.ini? – Nick Aug 24 '11 at 3:06
  • @Nick Have a look here, maybe some default setting breaks everything: php.net/manual/en/apc.configuration.php – LazyOne Aug 24 '11 at 7:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.