0
votes

I am trying to configure my Dreamhost VPS (running Debian and PHP5.3) to enable a PHP app to use an OAuth service provided by Autodesk, but the apps keeps failing because it can't find the OAuth class.

I installed the liboauth-php package using aptitude, and restarted the Apache server, but I get a "Fatal error: Class 'OAuth' not found" error.

I researched other pages here on stackoverflow that refer to installing OAuth, PECL and Pear and tried various suggestions I found in other threads, but they have each run into other problems.

I expect that I need to add the following declaration to the php.ini file so that the PHP parser can find the OAuth class, and then put the oauth.so file in the proper directory:

[PHP_OAUTH]

extension=oauth.so

Unfortunately I can't find a oauth.so shared object on the system.

So I thought maybe I could build one using PECL, since the aptitude install of liboauth-php package didn't fix this problem. Unfortunately PECL wasn't installed either. I tried "pear pickle" to install the PECL package but this too failed with this error:

PHP Warning: PHP Startup: Unable to load dynamic library '/imagick.so' - /imagick.so: cannot open shared object file: No such file or directory in Unknown on line 0 Unable to open package2.xml

When that failed, I tried upgrading pear but it also fails with the same error.

PHP Warning: PHP Startup: Unable to load dynamic library '/imagick.so' - /imagick.so: cannot open shared object file: No such file or directory in Unknown on line 0 Unable to open package2.xml

I tried using aptitude to install ndn-php53-imagick, php5-imagick and ndn-phpimagick but the last one failed:

Unpacking ndn-phpimagick (from .../ndn-phpimagick_3.0.1-0_amd64.deb) ...

dpkg: error processing /var/cache/apt/archives/ndn-phpimagick_3.0.1-0_amd64.deb (--unpack):

trying to overwrite '/etc/php53/conf.d/imagick.ini', which is also in package ndn-php53-imagick 3.0.1-6

configured to not write apport reports

                                  dpkg-deb: subprocess paste killed by signal (Broken pipe)

Errors were encountered while processing:

/var/cache/apt/archives/ndn-phpimagick_3.0.1-0_amd64.deb

E: Sub-process /usr/bin/dpkg returned an error code (1)

A package failed to install.

How can I get an oauth.so file or otherwise get the OAuth class recognized by the PHP parser?

1

1 Answers

0
votes

The Debian package (as you noticed) does not include oauth.so (I'm not sure why, but it is Debian so could be anything), and I have been unable to find a package for it.

http://bquery.com/blog/post/php_oauth_extension_-_debian_squeeze_installation/

So far thats the only answer I have found. Note that the libpcre-dev might be libpcre3-dev (depends on Debian version), and you will need to install php-pear (php5-pear) to get the pecl command, and php5-dev for pecl to actually work (package dependency hell for just one shared lib).

imagick (ImageMagick) is (should be) unrelated to pear, oauth, pickle, and everything else. Its just an image processing package (resize/rotate/edit images).

After its all installed be sure the extension=oauth.so line is in your php.ini for the proper php (cli vs apache vs ...).