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 :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
shell script with shell_exec() [message #180113] Wed, 09 January 2013 00:32 Go to next message
Erick Engelke is currently offline  Erick Engelke
Messages: 2
Registered: January 2013
Karma: 0
Junior Member
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] Wed, 09 January 2013 01:22 Go to previous messageGo to next message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma: 0
Senior Member
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 11:10 Go to previous messageGo to next message
Captain Paralytic is currently offline  Captain Paralytic
Messages: 204
Registered: September 2010
Karma: 0
Senior Member
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 14:02 Go to previous messageGo to next message
Erick Engelke is currently offline  Erick Engelke
Messages: 2
Registered: January 2013
Karma: 0
Junior Member
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 16:20 Go to previous message
The Natural Philosoph is currently offline  The Natural Philosoph
Messages: 993
Registered: September 2010
Karma: 0
Senior Member
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.
  Switch to threaded view of this topic Create a new topic Submit Reply
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: Thu Sep 19 22:37:32 GMT 2024

Total time taken to generate the page: 0.02520 seconds