S3 Curl and ASL

Support/Development for PHP
laughingbuddha
Forum Regular
Forum Regular
Posts: 512
Joined: Mon Mar 10, 2008 9:12 pm
Location: Southampton, UK

S3 Curl and ASL

Unread post by laughingbuddha »

Hi all,

I'm attempting to use Undesigned's PHP S3 Class (http://undesigned.org.za/2007/10/22/amazon-s3-php-class) that uses PHP 5.2.x and CURL, but keep hitting a brick wall on it. The main issue is that I'm getting this error:

Code: Select all

curl_setopt() [<a href='function.curl-setopt'>function.curl-setopt</a>]: CURLOPT_FOLLOWLOCATION cannot be activated when safe_mode is enabled or an open_basedir is set
So I figured, ok I'll disable Safe Mode in Plesk. Erm that didn't work, ok well maybe I'll run phpinfo and see what's happening. Erm nope, ok maybe Allow PHP Info is set to No in ASL, so I switch that to Yes, and still no phpinfo. Grrr, ok so I next I turn Safe Mode off in ASL as well. Finally starting to get somewhere.

But still the issue is I just can't seem to get past this error. I'm wondering is anyone else here has used this class, or could help me with this issue.

Thanks, Matt
Matt

"Given that God is infinite, and that the universe is also infinite... would you like a toasted teacake?"

about.me/mattauckland
twitter.com/mattauckland
scott
Atomicorp Staff - Site Admin
Atomicorp Staff - Site Admin
Posts: 8355
Joined: Wed Dec 31, 1969 8:00 pm
Location: earth
Contact:

Re: S3 Curl and ASL

Unread post by scott »

Plesk is setting that open_basedir too.
laughingbuddha
Forum Regular
Forum Regular
Posts: 512
Joined: Mon Mar 10, 2008 9:12 pm
Location: Southampton, UK

Re: S3 Curl and ASL

Unread post by laughingbuddha »

Is there an option to change it in Plesk? I couldn't see anything in the CP.
Matt

"Given that God is infinite, and that the universe is also infinite... would you like a toasted teacake?"

about.me/mattauckland
twitter.com/mattauckland
prupert
Forum Regular
Forum Regular
Posts: 573
Joined: Tue Aug 01, 2006 2:45 pm
Location: Netherlands

Re: S3 Curl and ASL

Unread post by prupert »

laughingbuddha wrote:Is there an option to change it in Plesk? I couldn't see anything in the CP.
In Plesk 11.x you can alter the open_basedir value for a specific domain via the PHP Settings page under the Subscription website settings. Alternatively (or in other cases) you can disable open_basedir via a vhost.conf.

For security reasons it is not recommended to disable open_basedir. Where possible I would suggest only disabling open_basedir for a specific directory where the PHP script that requires this is located.
Lemonbit Internet Dedicated Server Management
laughingbuddha
Forum Regular
Forum Regular
Posts: 512
Joined: Mon Mar 10, 2008 9:12 pm
Location: Southampton, UK

Re: S3 Curl and ASL

Unread post by laughingbuddha »

Ok. So if I'm running an MVC framework, and the class file that is being called to run the command is in say the libs folder, I would disable it for that folder. Is that right?

Basically how I'm using the script is to upload the file to the server, processes it, then upload it to S3 bucket. In this case it is handling an image.

So with that in mind, what is the command needed for the vhost to disable it for just one directory?

Thanks
Matt

"Given that God is infinite, and that the universe is also infinite... would you like a toasted teacake?"

about.me/mattauckland
twitter.com/mattauckland
laughingbuddha
Forum Regular
Forum Regular
Posts: 512
Joined: Mon Mar 10, 2008 9:12 pm
Location: Southampton, UK

Re: S3 Curl and ASL

Unread post by laughingbuddha »

Think I've got it to work, without having to mess about with the open_basedir. Someone made a patch to that S3 class, but it never got officially released. However I found the patch details in the gethub repo, and applied the changes. Added to that some security policy changes to the user account I created to perform these tasks, and we have a working script. YAY!

Anyone else happen to come across the same issue, drop me a message and I'll pass the script with the changes over to you.
Matt

"Given that God is infinite, and that the universe is also infinite... would you like a toasted teacake?"

about.me/mattauckland
twitter.com/mattauckland
Post Reply