Someone please stop me from throwing my computer.
I am coming up on 20 hours trying to solve this problem. I have read many post that gave me lots of good ideas. but I cant seem to make any of them work for me.
Background:
OS: ubuntu 7.1
Apache2
PHP5
::High level objective::
I want to execute a vb script via php.
The script finds a data file in the same directory and processes the data into another file in the same DIR.
::What I have gotten to work::
I can use wine in the terminal to successfully run the script.
I then created a super simple bash script so that apache will only have to have permission to run the script file. The script works when I double click on it and select run from the options provided. Sound good?
#!/bin/bash
cd /var/www/processed
wine /var/www/processed/extractor.exe
which leads to:
::Question 1::
How do I make absolutely sure that apache has enough permissions to execute the script?
I am using the script because I dont know if apache2 has permission to use wine.
::Question 2::
How do I execute the code in PHP?
What does not work:
shell_exec('callscript');
shell_exec('extractor.exe');
shell_exec('ls -l'); lists the extractor with the appropriate executable permissions.
shell_exec('PWD'); shows the correct current directory
shell_exec('whoami'); Returns www-data
::Question 3::
I took a look at the apache error log and found that when wine is call directly from PHP I get:
[Thu Nov 15 09:16:19 2007] [error] [client 192.168.1.1] File does not exist: /var/www/favicon.ico
wine: can't get temp file name for /var/www/.wine : Permission denied
When I call the script I get:
[Thu Nov 15 12:09:54 2007] [error] [client 192.168.1.1] Could not fetch resource information. [301, #0]
[Thu Nov 15 12:09:54 2007] [error] [client 192.168.1.1] (2)No such file or directory: Requests for a collection must have a trailing slash on the URI. [301, #0]
OR
[Thu Nov 15 12:14:24 2007] [error] [client 192.168.1.1] Could not fetch resource information. [403, #0]
[Thu Nov 15 12:14:24 2007] [error] [client 192.168.1.1] (2)No such file or directory: The URI does not contain the name of a repository. [403, #190001]
I am also getting an error every time the page is accessed. It maybe unrelated but I don't know how to get rid of it or where it is coming from.
sh: callscript: not found
[Thu Nov 15 11:37:26 2007] [error] [client 192.168.1.1] File does not exist: /var/www/favicon.ico
I never wanted to have a favicon and I dont know where the request is coming from. I checked the apache2.conf and httpd there is nothing there.
Please Help,
Thanks
Buggin