Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Working to get a CentOS / Apache / PHP stack running... At this point, I have SSH access, and in the Bash, can use php to do simple math; so I know the php is on the machine and working, (sorta). Also, Apache must be okay; I can stop and start it and just the fact I can get to my ip and use bash says it's ON, I deduce. Finally to the moment.

When I navigate to the server over the internet, no website! But,in the php error log, I get an error message very similair to this, one for each module in the php package:

[12-Aug-2012 18:34:53] PHP Warning: PHP Startup: Unable to load dynamic library '/etc/php.d/' - /etc/php.d/ cannot open shared object file: No such file or directory in Unknown on line 0

Sure would be good to recieve a hint where to look next.

share|improve this question
I am constantly amazed at the sharing worldwide. Thanks for your responses fellas, it'll take me a couple hours, and in the last half hour I finally found a few pointers via google; but I will work with your replies first!!! – MountainMan Aug 13 '12 at 3:42
Okay, all the .ini files are in /etc/php.d, but this:[root@bryanserver php.d]# php -i |grep extension extension_dir => /etc/php.d => /etc/php.d seems like it is wrong. Going as fast as this noob can... :) – MountainMan Aug 13 '12 at 3:51
Okay, from a tip from Google, this find verified file is ON the server: [root@bryanserver etc]# find / -name /usr/lib64/php/modules/ [root@bryanserver etc]# and sure enough I confirmed that, looked it up down in /usr/... and did a get to my notebook; yep it's a file with all those funny characters, so all 20 php .so files are in the usual place, now back to sorting the path issues; oh, the ini files all seem to be patterned after the curl.ini I inspected. – MountainMan Aug 13 '12 at 4:29
up vote 0 down vote accepted

On CentOS, by default, the PHP extension directory is set to /usr/lib(64)/php/modules:

# php -i | grep extension
extension_dir => /usr/lib64/php/modules => /usr/lib64/php/modules

and the curl extension is configured in:

# cat /etc/php.d/curl.ini 
; Enable curl extension module

If your PHP is compiled from source, make sure that cURL is enabled with --with-curl[=DIR]. If PHP was installed via yum, I suspect that someone is loading the cURL with wrong absolute path /etc/php.d/ You can find out by following command:

# grep -lr curl /etc/php.ini /etc/php.d/

Change to the relative path and restart Apache to see if it works.

share|improve this answer
Thanks for that help. I wouldn't have known what to look for without all those areas being identified. It was the php.ini file; there had been nothing defined in it for extension-dir, and extension_dir = "/usr/lib64/php/modules" got php working without the error mssgs which kicked off this question. – MountainMan Aug 13 '12 at 16:35

You should confirm that the file (/etc/php.d/ is not there. Then, consider either rebuilding the package that provides it, or the package that needs it. Alternatively, just use locate to find it on the machine, and create a symlink from the path mentioned in the error to the actual library.

The message itself is fairly self-explanatory - PHP needed the CURL library, and didn't find it where it was expected.

share|improve this answer
As it turned out, that would have been the first step, and as noted, they were not in that location. Thanks, cheers. – MountainMan Aug 13 '12 at 16:32

PHP curl library is part of php-common common package. As quanta responded above, follow those steps to resolve your error.

If you are compiling from source, ensure curl-devel is installed.

share|improve this answer
Why did my response get a down vote? May I ask? – Chida Aug 13 '12 at 3:25
curl was built into PHP by default. AFAIK, there is no such package on the CentOS. – quanta Aug 13 '12 at 3:33
Never mind, I figured it out. Thanks! – Chida Aug 13 '12 at 3:33
quanta, I just checked on my centos and my original command yum install php-curl. When run, centos actually attempts to get php-common in which curl is built in. So, technically the command works. Just FYI. – Chida Aug 13 '12 at 3:42

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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