-1

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/curl.so' - /etc/php.d/curl.so: 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.

John Gardeniers
  • 27,262
  • 12
  • 53
  • 108
MountainMan
  • 103
  • 5
  • 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 03: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 03:51
  • Okay, from a tip from Google, this *find* verified file is ON the server: [root@bryanserver etc]# find / -name curl.so /usr/lib64/php/modules/curl.so [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 04:29

3 Answers3

1

You should confirm that the file (/etc/php.d/curl.so) 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.

Falcon Momot
  • 24,975
  • 13
  • 61
  • 92
  • 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
0

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
extension=curl.so

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/curl.so. 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.

Chida
  • 2,471
  • 1
  • 16
  • 29
quanta
  • 50,327
  • 19
  • 152
  • 213
  • 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
-1

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.

Chida
  • 2,471
  • 1
  • 16
  • 29
  • Why did my response get a down vote? May I ask? – Chida Aug 13 '12 at 03:25
  • curl was built into PHP by default. AFAIK, there is no such package on the CentOS. – quanta Aug 13 '12 at 03: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 03:42