Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Apache user doesn't have the permissions neccessary to run cURL, fopen(), and others.

  1. #1
    Join Date
    Oct 2005
    Beans
    170

    Apache user doesn't have the permissions neccessary to run cURL, fopen(), and others.

    Hello,

    Alright, first off, I'm not using Ubuntu. I'm using Arch Linux. Now that that's out of the way:

    Secondly, much more details about my battle with this server can be found here. below is just the basics of what I've gotten to so far.

    Whenever I try to do a cURL function in a PHP page through a web browser, it fails, giving and error about `Couldn't resolve hosts`. However, that same PHP page with the curl functions succeed when run in the terminal, which has lead me to believe that Apache is the culprit (since it fails when being served from the Apache web server).

    I finally figured out why. The Apache user, http, doesn't have the permissions necessary to use the cURL, fopen(), and other web-site manipulation functions. I figured this out by making root the Apache server user, which then was able to successfully execute my PHP page from the web browser...

    Now what I want to know is how do I fix this. I have no leads as to where to go from here...

    Any help?

    PS: Sorry if this is the wrong forum, but I figured the Secuirty Discussions people would know more about permissions and whatnot.

  2. #2
    Join Date
    Jul 2009
    Location
    San Diego
    Beans
    102

    Re: Apache user doesn't have the permissions neccessary to run cURL, fopen(), and oth

    looks like you're not the only one w/these issues...have you tried google?

    http://curl.askapache.com/docs/knownbugs.html


    1. Re: chunked encoding problem ? - error messages from curl as well ...

      apache.org>. Subject, Re: chunked encoding problem ? - error messages from curl as well as lucene. Date, Tue, 30 Jun 2009 18:47:50 GMT ...
      mail-archives.apache.org/.../%3C9E90C585-D3E3-4E29-AD3C-DEB99B86E1B4@apache.org%3E - Cached - Similar -
    2. Re: chunked encoding problem ? - error messages from curl as well ...

      apache.org>. Subject, Re: chunked encoding problem ? - error messages from curl as well as lucene. Date, Wed, 01 Jul 2009 16:41:37 GMT ...
      mail-archives.apache.org/.../%3CED26000E-C9B8-48C9-A0BF-ED252CCF9157@apache.org%3E - Cached - Similar -
      Show more results from mail-archives.apache.org
    3. cURL with PHP and Apache on Windows

      cURL with PHP and Apache on Windows · Code October 22nd, 2003. Setting up cURL my linux server it was no problem at all, but I had a heck of a time getting ...
      www.tonyspencer.com/.../curl-with-php-and-apache-on-windows/ - Cached - Similar -
    4. installing php/curl on Apache problem: msg#00035

      I enabled curl in php.ini (extension=php_curl.dll), and when I restarted Apache I am getting a wierd error message pop-up "The procedure entry point ...
      osdir.com/ml/web.curl.php/2003-07/msg00035.html - Cached - Similar -
    5. 'installing php/curl on Apache problem' - MARC

      [prev in thread] [next in thread] List: curl-and-php Subject: installing php/curl on Apache problem From: "Felix Rabinovich" <felix () rabinovich ! org> ...
      marc.info/?l=curl-and-php&m=105954681806421&w=2 - Similar -
    6. Curl: installing php/curl on Apache problem

      installing php/curl on Apache problem. This message : [ Message body ] [ More options ]; Related messages : [ Next message ] [ Previous message ] ...
      curl.haxx.se/mail/curlphp-2003-07/0035.html - Cached - Similar -
    7. Arch Linux Forums / cURL, PHP, Apache, Insanity!

      3 posts - 2 authors - Last post: 5 days ago
      tl;dr: cURL doesn't work when it's used in a PHP application and ... An Apache problem? Below, I've included some network information that ...
      bbs.archlinux.org/viewtopic.php?pid=608122 - Similar -
    8. [#COUCHDB-387] curl: (56) Received problem 2 in the chunky parser ...

      Curl returned this at the end of the output: ---- curl: (56) Received problem 2 in the chunky parser ---- After changing the ë to a plain e this problem ...
      issues.apache.org/jira/browse/COUCHDB-387 - Cached - Similar -
    9. Apache 2, PHP 5.1.4 And cURL

      Jun 19, 2006 ... But I still have problems using the curl libraryof functions if I go through Apache. Using the php compiler from command line works just ...
      www.astahost.com/info.../Apache-2-Php-514-Curl_t12464.html - Cached - Similar -
    10. cURL - Known Bugs

      May 11, 2009 ... This is the document 'docs/KNOWN_BUGS' from the curl release archive. These are problems known to exist at the time of this release. ...
      curl.askapache.com/docs/knownbugs.html - Cached - Similar -

  3. #3
    Join Date
    Oct 2005
    Beans
    170

    Re: Apache user doesn't have the permissions neccessary to run cURL, fopen(), and oth

    Quote Originally Posted by dk06 View Post
    looks like you're not the only one w/these issues...have you tried google?

    http://curl.askapache.com/docs/knownbugs.html
    Admittedly, I haven't done an extensive search since I discovered that Apache didn't have the permissions. But I did search Google as if it was a Bible trying to figure out why cURL wasn't working in the first place. The results I got were mostly inconclusive or very much outdated... The searching I did do in respect to Apache's permissions only turned up irrelevant things like making sure your web directory has the correct chmod for the server to read.

    Thanks for the links, I'll look into them. =) What search term did you use specifically?

    EDIT: Also, one of those search results are mine from the Arch Linux forums. =P

    EDIT 2: Upon reviewing the links that you posted, most of them are either irrelevant to my problem (or I'm not reading them right -- mailing lists tend to be a little to technical for me to follow), deal with the installation of cURL (which isn't my problem), or deal with Windows instead of Linux (I have no idea if the windows versions are much different). Thanks for the help, though, I appreciate it. =)
    Last edited by XtremeGamer99; August 27th, 2009 at 08:43 AM.

  4. #4
    Join Date
    Jul 2009
    Location
    San Diego
    Beans
    102

    Re: Apache user doesn't have the permissions neccessary to run cURL, fopen(), and oth

    no worries, I just notice a lot of posters could save time by checking google

    (posting in forums can be really helpful too I've just found google to be an excellent resource in addition to forums)

    cURL and apache problem
    Have a good one & good luck!

    edit:

    I'll take another look, thought I saw something similar

  5. #5
    Join Date
    Oct 2005
    Beans
    170

    Re: Apache user doesn't have the permissions neccessary to run cURL, fopen(), and oth

    Quote Originally Posted by dk06 View Post
    no worries, I just notice a lot of posters could save time by checking google

    (posting in forums can be really helpful too I've just found google to be an excellent resource in addition to forums)

    Have a good one & good luck!

    edit:

    I'll take another look, thought I saw something similar
    The similar one is probably my post on Arch. xD

    I will also continue searching for this. It's been kicking me in the rump for the past week now and I want it solved.

  6. #6
    Join Date
    Jul 2009
    Location
    San Diego
    Beans
    102

    Re: Apache user doesn't have the permissions neccessary to run cURL, fopen(), and oth

    http://www.astahost.com/info.php/Apa...rl_t12464.html
    I have been running PHP 5.1.4 and Apache 2.2.2 with the PHP 5.2.0 developement phpapache2_2.dll module. I recently installed CURL with php. Now if I run php from the command line, I can use the CURL functions, but not from a webpage through Apache. Also, phpinfo() returns nothing on CURL. I am running Windows XP SP2 and installed PHP manually via the zipped binaries. I really need CURL to work through a webpage and would appreciate any help I can get.
    http://curl.haxx.se/mail/lib-2009-08/0253.html

    http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=478864


    possible fix:

    http://thebigbyte.blogspot.com/2009/...-on-linux.html

    How To Enable Curl in PHP on Linux


    To enable PHP Curl support on Linux with apache 2:

    $ sudo apt-get install php5-curl

    Or do it manually (compiling sources):
    http://au2.php.net/manual/en/curl.installation.php
    http://curl.haxx.se/libcurl/php/install.html
    http://www.wallpaperama.com/forums/h...led-t1576.html



    This entry was written by David and posted on Monday, August 03, 2009 and filed under apache , linux , open source , php Bookmark the permalink . Follow any comments here with the RSS feed for this post . Post a comment ( in a new window )
    Last edited by dk06; August 27th, 2009 at 09:06 AM.

  7. #7
    Join Date
    Oct 2005
    Beans
    170

    Re: Apache user doesn't have the permissions neccessary to run cURL, fopen(), and oth

    Thank you for looking into this. I stumbled on a few of these pages as well. But unfortunately, most of these aren't relevant or don't address my issue as I have it.

    To clarify - cURL works. No doubt about it. I've tried it on the terminal, I've tried it through PHP scripts... there isn't a thing wrong with cURL. However, there is a problem with Apache and the web server user not have the proper permissions to perform cURL and other URL operations (for whatever reason). I'd like to find out why and how to fix that, if there is a way. x_x

    Again, thanks for your help. I appreciate all the help I can get; otherwise, I'd throw the machine out the window.

  8. #8
    Join Date
    Jul 2009
    Location
    San Diego
    Beans
    102

    Re: Apache user doesn't have the permissions neccessary to run cURL, fopen(), and oth

    Quote Originally Posted by XtremeGamer99 View Post
    Thank you for looking into this. I stumbled on a few of these pages as well. But unfortunately, most of these aren't relevant or don't address my issue as I have it.

    To clarify - cURL works. No doubt about it. I've tried it on the terminal, I've tried it through PHP scripts... there isn't a thing wrong with cURL. However, there is a problem with Apache and the web server user not have the proper permissions to perform cURL and other URL operations (for whatever reason). I'd like to find out why and how to fix that, if there is a way. x_x

    Again, thanks for your help. I appreciate all the help I can get; otherwise, I'd throw the machine out the window.
    I'm not running apache but if you go into your users/groups & edit the permissions (add curl to the apache user) would that work

    again, I don't have apache or curl but I've had a lot of program user/groups that I've needed to edit the permissions on for other things in order for them to work properly.

    can't think of any other potential solutions, and you're right...it's a tough one to search in google

  9. #9
    Join Date
    Oct 2005
    Beans
    170

    Re: Apache user doesn't have the permissions neccessary to run cURL, fopen(), and oth

    Quote Originally Posted by dk06 View Post
    I'm not running apache but if you go into your users/groups & edit the permissions (add curl to the apache user) would that work

    again, I don't have apache or curl but I've had a lot of program user/groups that I've needed to edit the permissions on for other things in order for them to work properly.

    can't think of any other potential solutions, and you're right...it's a tough one to search in google
    Sorry if this is a newbish question, but how would I add the cuRL program to the http user?

    I'll continue to search. =P

  10. #10
    Join Date
    Jul 2009
    Location
    San Diego
    Beans
    102

    Re: Apache user doesn't have the permissions neccessary to run cURL, fopen(), and oth

    Quote Originally Posted by XtremeGamer99 View Post
    Sorry if this is a newbish question, but how would I add the cuRL program to the http user?

    I'll continue to search. =P

    I have apps like Splunk, OSSEC,...etc... that actually have a username, I was assuming maybe Apache had one and apps like VMware & Virtualbox, you need to edit the permissions on your users and add the VMware/VBox group premissions to the user


    I don't run a web server so I don't know if that applies to Apache or cURL, but it was just a thought

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •