logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Other Software View previous topic :: View next topic
Reply to topic   Topic: Possible php exec() issue? Or permission item?
Author
Triple_Nothing



Joined: 01 Apr 2012
Posts: 39
Location: WI, USA

PostPosted: Fri 06 Apr '12 23:34    Post subject: Possible php exec() issue? Or permission item? Reply with quote

Ever since my recent update, I just had to add the new variable to offer a larger upload size and my customers could upload content, i.e. images of for-sale product. An issue I do have, however, is a string that is supposed to alter these images. It worked just fine before my Apache/PHP update/alteration, but now it doesn't. I cannot find an error, even though one of the filesize posted before I added its setting. It seems the line is perhaps skipped, but we all know this doesn't happen...often... :-p

Here's my line: (I guessin' maybe a permission on the exec or something?)
Code:
exec('magickcmd convert "' . $basedir . 'images/items/' . $_POST['catid'] . '/' . $item['id'] . '.jpg" -resize 600x448 "' . $basedir . 'images/items/' . $_POST['catid'] . '/' . $item['id'] . '.jpg"');

So, simply:
Code:
exec('magickcmd convert "images/picture.jpg" -resize 600x448 "images/picture2.jpg"');


It just takes their random image and alters it to fit their site's layout accordingly. I do have them able to upload their items so they are not completely down atm, but they've no thumbnails for listed viewing, and random, if not huge, images on details page.

Any help is greatly appreciated. Thank you!
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7298
Location: Germany, Next to Hamburg

PostPosted: Sat 07 Apr '12 12:17    Post subject: Reply with quote

That it doesn't work helps nothing to figure it out. What error message do you get? php error log? apache error log? Windows event log? Your OS?
Back to top
Triple_Nothing



Joined: 01 Apr 2012
Posts: 39
Location: WI, USA

PostPosted: Sat 07 Apr '12 14:00    Post subject: Reply with quote

Well, I'm running Server 2008 R2 Enterprise on this machine. What's making this difficult is I am not finding any error anywhere, as though it's running fine. The error for the image size was posting in the Apache error log, but now that's clean. I even changed 'magickcmd' to 'mhagickcmd' to intentionally be errored, but I find no error anywhere. :-/

I even tossed a copy() command just above my exec() command which worked just fine. With finding no errors, it seems to run smoothly as though I've commented the exec() line out or something. :-S
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7298
Location: Germany, Next to Hamburg

PostPosted: Tue 10 Apr '12 23:03    Post subject: Reply with quote

With my simple english knowledge I can't follow you now. Is your issue solved?
Back to top
Triple_Nothing



Joined: 01 Apr 2012
Posts: 39
Location: WI, USA

PostPosted: Wed 11 Apr '12 5:09    Post subject: Reply with quote

Ya. I stepped back from trying the fcgid_module and just went the CGI setup.
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7298
Location: Germany, Next to Hamburg

PostPosted: Wed 11 Apr '12 20:39    Post subject: Reply with quote

Hasn't the cgi setup of PHP slowed down your server?
Back to top
Triple_Nothing



Joined: 01 Apr 2012
Posts: 39
Location: WI, USA

PostPosted: Wed 11 Apr '12 20:43    Post subject: Reply with quote

I know CGI is slower. Before this update of everything, I was running via ISAPI, n figured I'd try FastCGI, but couldn't figure out why no exec() functions would proccess n not even create an error anywhere. Then tried CGI and everything is successfully working. *shrugz*
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7298
Location: Germany, Next to Hamburg

PostPosted: Wed 11 Apr '12 20:48    Post subject: Reply with quote

Well for testing you should change your php.ini

Code:
error_reporting = E_ALL
display_errors = On
display_startup_errors = On


PHP as module didn't work?
Back to top
Triple_Nothing



Joined: 01 Apr 2012
Posts: 39
Location: WI, USA

PostPosted: Wed 11 Apr '12 20:54    Post subject: Reply with quote

I got the fcgid_module to load, but my best guess was perhaps a permission issue somewhere I couldn't find.

As far as my error reporting, I even run my production at development levels. If there is an error, it should be posted. ^_^

I would have stayed with the fcgid_module, BUT the ONLY issue I had, atm, was getting exec() items to process. It didn't even offer me error's anywhere I found to help troubleshoot. Confused
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7298
Location: Germany, Next to Hamburg

PostPosted: Mon 16 Apr '12 11:45    Post subject: Reply with quote

You may post your fcgid config, so I can try to find the issue.
Back to top
Triple_Nothing



Joined: 01 Apr 2012
Posts: 39
Location: WI, USA

PostPosted: Tue 17 Apr '12 1:18    Post subject: Reply with quote

This is pretty much every line mentioned during the install. The only I added was the 'FcgidMaxRequestLen 10240000' so we could work with larger files.

Code:
FcgidInitialEnv PHPRC "c:/Program Files (x86)/PHP"
FcgidInitialEnv PATH "c:/Program Files (x86)/PHP;C:/WINDOWS/system32;C:/WINDOWS;C:/WINDOWS/System32/Wbem;"
FcgidInitialEnv SystemRoot "C:/Windows"
FcgidInitialEnv SystemDrive "C:"
FcgidInitialEnv TEMP "C:/WINDOWS/Temp"
FcgidInitialEnv TMP "C:/WINDOWS/Temp"
FcgidInitialEnv windir "C:/WINDOWS"
FcgidIOTimeout 64
FcgidConnectTimeout 16
FcgidMaxRequestsPerProcess 500
FcgidMaxRequestLen 10240000
   
<Files ~ "\.php$>"
  AddHandler fcgid-script .php
  FcgidWrapper "c:/Progra~2/PHP/php-cgi.exe" .php
</Files>
Back to top
Triple_Nothing



Joined: 01 Apr 2012
Posts: 39
Location: WI, USA

PostPosted: Tue 17 Apr '12 3:12    Post subject: Reply with quote

PHP DOES run successfully, so it's not like it won't load or anything. It runs just as expected, except APPEARS to void/ignore any exec() functions.
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7298
Location: Germany, Next to Hamburg

PostPosted: Wed 18 Apr '12 11:49    Post subject: Reply with quote

It is might FcgidInitialEnv PATH

Can you try to run exec with a full path to the program you try to run?
Back to top


Reply to topic   Topic: Possible php exec() issue? Or permission item? View previous topic :: View next topic
Post new topic   Forum Index -> Other Software