473,507 Members | 3,112 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

POVRay through PHP

Hello all

I have trouble in calling POVRay through PHP.

This is what I tried:

- create a PHP file (say call.php) with the content
<?php
header("Content-Type: image/png");
passthru("./xxx.cgi");
?>

- have the following in xxx.cgi
#!/bin/bash
/usr/local/bin/povray +O- myfirst.pov 2> /tmp/errors.txt

which supposedly send the picture to stdin in PNG format.

Result:
The browser displays "The image http://.../call.php cannot be
displayed, because it contains errors."

The access_log records a status 200 line, error_log contains
"./xxx.cgi: line 2: 27809 segmentaion fault /usr/local/bin/povray \
+O- myfirst.pov 2> /tmp/errors.txt"

and /tmp/errors.txt is empty.
Executing ./xxx.cgi on the command line, works as expected:
a binary is sent to the screen, /tmp/errors.txt contains the
usual POVRay log.
The obvious mistake of not having privileges is IMHO solved.

a) I can do "su - nobody" (Apache runs as nobody:nogroup) and
execute xxx.cgi, it works.

b) I've changed the user:group of Apache process to be myself
(normaluser:users). It didn't help.
Why POVRay behaves differently if called from PHP is a puzzle.
Just as a control experiment I tried this:
change call.php to
<?php
header("Content-Type: text/html");
passthru("./xxx.cgi");
?>

and have a xxx.cgi like
#!/bin/bash
/usr/bin/pod2html /usr/doc/openssl-0.9.6d/doc/crypto/rc4.pod

It works properly, i.e. I get the formatted HTML version of rc4.pod.
Can somebody explanation this?

Arun

Jul 16 '05 #1
0 1724

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1987
by: Roger Lord | last post by:
I'm trying to cause povray to render an image dynamically with php. I've tried system() and get the same result. $cmd = "/usr/local/bin/povray +Itest.pov -d +W800 +H600 +Q9 +A0.3 +FN...
13
3387
by: takashi | last post by:
Hi, I have a question. I am learning about how to use c++ language. I have attempted to make my own programs, using the knowledge that I have, but sometimes when I get stuck on writing a code, it...
32
5844
by: Protoman | last post by:
I have a function that calculates the mean of the some numbers; I need it to accept any number of parameters (one needs to be the number of the other parameters) Can you help me out here? Here's...
28
2447
by: Jed | last post by:
Hello to all! I have a couple of projects I intend starting on, and was wondering if someone here could make a suggestion for a good compiler and development environment. My goals are as...
7
557
by: vikas | last post by:
Hi, Can anybody suggest a IDE for C++ in which I can import my code and make class diagram and doc. Say something like netbeans in java (makes javadoc). I checked out, but even VS 2005 doesn't...
8
1690
GCC
by: coinjo | last post by:
>From where i can download the GCC?
20
5077
by: Manuel | last post by:
Hi. Before all, please excuse me for bad english and for very newbie questions. I hope to don't boring you. I'm trying to write a very simple GUI using openGL. So I'm writing some different...
78
4119
by: arnuld | last post by:
hai all, i am standing on a "crossroad to C++". I am here in front of you as i have a problem. i will be brief. Please do not think: "arnuld is sick", i am really struggling & doing hard-work to...
2
2738
by: nvinhphu | last post by:
Dear all, I would like to generate images like the ones in the right column at this link http://www.micthemodel.org/pages/examples.html (Sorry but I can not post attachment). These images...
0
7221
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7109
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
7029
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
5039
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4702
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3190
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1537
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
758
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
411
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.