By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,009 Members | 1,767 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,009 IT Pros & Developers. It's quick & easy.

Problems starting a console application though PHP

P: n/a
Hi to everyone!

I have an Apache Webserver running on Win2000.
I try to start a console application an the server though PHP, with the
functions exec() or passthru() but it doesn't work.
The application starts though, but doesn't work in the same way I would
start it local on the web server (I mean though a "normal doubleclick").

I think it depends on the type of application, cause I ca start with PHP for
example other programms and they work fine!!

Before I write about the specifications of my console application, I have
this question:

What are the technical differences between starting an application through
PHP and starting it local on the machine???

Thank a lot

Maria SORANA


Jul 3 '06 #1
Share this Question
Share on Google+
7 Replies


P: n/a
Check your file access permission. Allow web server to read and execute
that file.

--
http://www.groupvita.com
m.******@schiketanz.at wrote:
Hi to everyone!

I have an Apache Webserver running on Win2000.
I try to start a console application an the server though PHP, with the
functions exec() or passthru() but it doesn't work.
The application starts though, but doesn't work in the same way I would
start it local on the web server (I mean though a "normal doubleclick").

I think it depends on the type of application, cause I ca start with PHP for
example other programms and they work fine!!

Before I write about the specifications of my console application, I have
this question:

What are the technical differences between starting an application through
PHP and starting it local on the machine???

Thank a lot

Maria SORANA
Jul 3 '06 #2

P: n/a
Thanks!

Sorry, I've checked the Apache ini-file, but I didn't find where to change
my file access permissions.
Can you give me a hint? I am not so expert in web server and PHP.

Maria
Jul 3 '06 #3

P: n/a
m.******@schiketanz.at wrote:
Hi to everyone!

I have an Apache Webserver running on Win2000.
I try to start a console application an the server though PHP, with the
functions exec() or passthru() but it doesn't work.
The application starts though, but doesn't work in the same way I would
start it local on the web server (I mean though a "normal doubleclick").

I think it depends on the type of application, cause I ca start with PHP for
example other programms and they work fine!!

Before I write about the specifications of my console application, I have
this question:

What are the technical differences between starting an application through
PHP and starting it local on the machine???

Thank a lot

Maria SORANA
To get a windows app to run in Windows XP (invoked by Php Apache
module), I had to open the services console (services.msc), select the
Apache service - Properties, and check Allow service to Interact with
desktop. You might try that.

--
*****************************
Chuck Anderson Boulder, CO
http://www.CycleTourist.com
Everyone's journey should be different,
so that we all are enriched
in new and endless ways
*****************************
Jul 3 '06 #4

P: n/a
m.******@schiketanz.at wrote:
Hi to everyone!

I have an Apache Webserver running on Win2000.
I try to start a console application an the server though PHP, with the
functions exec() or passthru() but it doesn't work.
The application starts though, but doesn't work in the same way I would
start it local on the web server (I mean though a "normal doubleclick").

I think it depends on the type of application, cause I ca start with PHP for
example other programms and they work fine!!

Before I write about the specifications of my console application, I have
this question:

What are the technical differences between starting an application through
PHP and starting it local on the machine???
Maria,

There are several differences between them, some major ones being
environment variables, exit status, and visibility. So before I write
about the specifics of your problem, I have this question:

What is the specific code that isn't working, and how do you know the
application starts, and if it starts, what does it mean for it not to
work? Please be detailed and specific.

Csaba Gabor from Vienna

Jul 4 '06 #5

P: n/a
Thank a lot and sorry I am so late.
I changedthe properties in the service console as you wrote, but the
programm still don't work properly. I add more informations in the answer to
Csaba Gabor.
Jul 7 '06 #6

P: n/a
Thanks for the answer.

The thing is some complicate.
I wrote a VB6 programm with GUI which uses a COM object to send and retrieve
datas from a remore Reuters server. I send a sql query and I get the
response. The COM object works with events: when tha datas are retrieved
then an event will be fired and so on.
Well, I tried to start this programm through PHP but it did not work.
First I thought the problem is the GUI, so I changed the programming
language and I write a similar console application in VB.NET.

Now, if I start the programm local on the server, it works. It sends the sql
and after few seconds gets the response back and saves it.

If I start it through PHP, it executes but it is not able to instantiate the
COM object...

Jul 7 '06 #7

P: n/a
m.******@schiketanz.at wrote:
Thanks for the answer.

The thing is some complicate.
I wrote a VB6 programm with GUI which uses a COM object to send and retrieve
datas from a remore Reuters server. I send a sql query and I get the
response. The COM object works with events: when tha datas are retrieved
then an event will be fired and so on.
Well, I tried to start this programm through PHP but it did not work.
First I thought the problem is the GUI, so I changed the programming
language and I write a similar console application in VB.NET.

Now, if I start the programm local on the server, it works. It sends the sql
and after few seconds gets the response back and saves it.

If I start it through PHP, it executes but it is not able to instantiate the
COM object...
This is like pulling teeth. Let me be more specific: "Please be
detailed and specific." means that I want to see the relevant lines of
code. I don't want to see all your code, but I do want to see how you
(that is to say: the lines of code that) create the COM object and how
you (lines of code that) hook up the event handling. And I also want
to see the specific line that it fails on. Also, and possibly most
importantly, exactly how do you start PHP (and if it's scheduled, the
exact scheduling line should be provided (using password placeholders,
of course)).

Furthermore, the context that PHP is started under is extremely
important. You have said "local on the server". The implication is
that the (eventual and expected) behaviour is one where a web page
request kicks off a server side PHP script which script is attempting
to work with the COM object (is my inference correct? If not outline
the scenario). There surely is a security (permissions) issue here.

Csaba

Jul 8 '06 #8

This discussion thread is closed

Replies have been disabled for this discussion.