473,666 Members | 2,073 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:use rs). 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 1736

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

Similar topics

0
1996
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 +Otest.png"; $str = exec($cmd); // Segmentation fault (core dumped) header("Content-Type: image/png"); $im = imagecreatefrompng("test.png"); imagepng($im);
13
3399
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 took me a long time to figure out what I should do. For instance, I was writing a program which tells you all the prime numbers that are less than the number you input on the console. It was a very short program, but it took me a while to write...
32
5871
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 the function: const long double& mean(long long x) { vector<int> v(x); for(int i= 1; i <=x; ++i) { v.push_back(i);
28
2465
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 follows: 1. Develop the project code on XP.
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 provide this support (I am using VC++ 6.0 as of now). Is there any of them(in case it is actually them!) which is freely available for evaluation. Thanks, vikas
8
1703
GCC
by: coinjo | last post by:
>From where i can download the GCC?
20
5095
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 widgets classes, like buttons, images, slider, etc... Each class has a draw() method.
78
4164
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 become a Modern C++ Programmer & i am feeling as if i am standing on a crossroad. i am asking because every time i made a decision on my own, in my past, i always ran into huge wastage of time, money & effort. that is why i am posting it here:
2
2751
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 are in fact 2D slices of a 3D image of a cube containing a set
0
8356
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8871
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8783
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8552
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8640
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7387
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6198
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4369
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2773
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 we have to send another system

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.