Author |
|
Triple_Nothing
Joined: 01 Apr 2012 Posts: 39 Location: WI, USA
|
Posted: Fri 06 Apr '12 23:34 Post subject: Possible php exec() issue? Or permission item? |
|
|
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: 7371 Location: Germany, Next to Hamburg
|
Posted: Sat 07 Apr '12 12:17 Post subject: |
|
|
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
|
Posted: Sat 07 Apr '12 14:00 Post subject: |
|
|
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: 7371 Location: Germany, Next to Hamburg
|
Posted: Tue 10 Apr '12 23:03 Post subject: |
|
|
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
|
Posted: Wed 11 Apr '12 5:09 Post subject: |
|
|
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: 7371 Location: Germany, Next to Hamburg
|
Posted: Wed 11 Apr '12 20:39 Post subject: |
|
|
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
|
Posted: Wed 11 Apr '12 20:43 Post subject: |
|
|
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: 7371 Location: Germany, Next to Hamburg
|
Posted: Wed 11 Apr '12 20:48 Post subject: |
|
|
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
|
Posted: Wed 11 Apr '12 20:54 Post subject: |
|
|
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. |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Mon 16 Apr '12 11:45 Post subject: |
|
|
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
|
Posted: Tue 17 Apr '12 1:18 Post subject: |
|
|
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
|
Posted: Tue 17 Apr '12 3:12 Post subject: |
|
|
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: 7371 Location: Germany, Next to Hamburg
|
Posted: Wed 18 Apr '12 11:49 Post subject: |
|
|
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 |
|