FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » shell script with shell_exec()
Show: Today's Messages :: Unread Messages :: Show Polls :: Message Navigator
| Subscribe to topic | Bookmark topic 
Switch to threaded view of this topic Create a new topic Submit Reply
shell script with shell_exec() [message #180113] Tue, 08 January 2013 19:32 Go to next message
Erick Engelke is currently offline  Erick Engelke
Messages: 2
Registered: January 2013
Karma: 0
Junior Member
add to buddy list
ignore all messages by this user
I need to run some binaries from within php web pages.

Ironically, it's to convert Word/Excel to PDF, no joke, but open office
does it pretty easily. No need to buy someone's service.

My problem is, the cli version of PHP executes the scripts perfectly, but
the FreeBSD Apache module PHP 5.4.7 - which I believe doesn't have the
safe mode, well it does a SIG_ABORT on the open office binary.

I've been reading web pages all day but don't see how to get around this.

Erick
Re: shell script with shell_exec() [message #180114 is a reply to message #180113] Tue, 08 January 2013 20:22 Go to previous messageGo to next message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma: 0
Senior Member
add to buddy list
ignore all messages by this user
On 1/8/2013 7:32 PM, Erick Engelke wrote:
>
> I need to run some binaries from within php web pages.
>
> Ironically, it's to convert Word/Excel to PDF, no joke, but open office
> does it pretty easily. No need to buy someone's service.
>
> My problem is, the cli version of PHP executes the scripts perfectly, but
> the FreeBSD Apache module PHP 5.4.7 - which I believe doesn't have the
> safe mode, well it does a SIG_ABORT on the open office binary.
>
> I've been reading web pages all day but don't see how to get around this.
>
> Erick

You really didn't give us much to go on. But my first check would be to
ensure the web server user has sufficient permission to execute Open
Office and it's libraries. Also ensure it can read the file you're
converting from and write access to the directory you're writing to.

Next thing I would check would be the log files for any messages.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
Re: shell script with shell_exec() [message #180115 is a reply to message #180113] Wed, 09 January 2013 06:10 Go to previous messageGo to next message
Captain Paralytic is currently offline  Captain Paralytic
Messages: 204
Registered: September 2010
Karma: 0
Senior Member
add to buddy list
ignore all messages by this user
On Jan 9, 12:32 am, Erick Engelke <er...@uwaterloo.ca> wrote:
> I need to run some binaries from within php web pages.
>
> Ironically, it's to convert Word/Excel to PDF, no joke, but open office
> does it pretty easily.  No need to buy someone's service.

For Excel to PDF I use phpExcel. It'll read an Excel file and write it
as a PDF.

For Word you might be able to do something with phpwordlib.
Re: shell script with shell_exec() [message #180116 is a reply to message #180114] Wed, 09 January 2013 09:02 Go to previous messageGo to next message
Erick Engelke is currently offline  Erick Engelke
Messages: 2
Registered: January 2013
Karma: 0
Junior Member
add to buddy list
ignore all messages by this user
On Tue, 8 Jan 2013, Jerry Stuckle wrote:

> On 1/8/2013 7:32 PM, Erick Engelke wrote:
>>
>> I need to run some binaries from within php web pages.
>>
> You really didn't give us much to go on.

Thanks for your help. I figured it out, the www userid didn't have a
tempdir/homedir, so setting HOME to /tmp solved it.

Erick
Re: shell script with shell_exec() [message #180117 is a reply to message #180116] Wed, 09 January 2013 11:20 Go to previous message
The Natural Philosoph is currently offline  The Natural Philosoph
Messages: 993
Registered: September 2010
Karma: 0
Senior Member
add to buddy list
ignore all messages by this user
On 09/01/13 14:02, Erick Engelke wrote:
>
>
> On Tue, 8 Jan 2013, Jerry Stuckle wrote:
>
>> On 1/8/2013 7:32 PM, Erick Engelke wrote:
>>>
>>> I need to run some binaries from within php web pages.
>>>
>> You really didn't give us much to go on.
>
> Thanks for your help. I figured it out, the www userid didn't have a
> tempdir/homedir, so setting HOME to /tmp solved it.
>
> Erick

makes sense. In such cases having run with /tmp systems in the past that
filled up, id be tempted to create something under /var/tmp


Unless the files are truly temporary and vanish as fast as they are
created..

--
Ineptocracy

(in-ep-toc’-ra-cy) – a system of government where the least capable to
lead are elected by the least capable of producing, and where the
members of society least likely to sustain themselves or succeed, are
rewarded with goods and services paid for by the confiscated wealth of a
diminishing number of producers.
Quick Reply
Formatting Tools:   
  Switch to threaded view of this topic Create a new topic
Previous Topic: Files getting clobbered when I run out of disk space
Next Topic: Weekly PHP Newsletter
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Dec 16 08:10:36 EST 2017

Total time taken to generate the page: 0.00876 seconds