Issue while opening external program in PHP using apache

Alles, was den Apache betrifft, kann hier besprochen werden.

Issue while opening external program in PHP using apache

Postby sandytronics11 » 02. October 2015 17:22

I have created a program using PHP in which there is event on button click to open PDF using FoxIT Reader. For just one PDF its working well for a single user. I installed this on server and I have multiple users on server, for example: [(administrator -- user-1), (sam -- user-2), (mac -- user-3)] and so one.

I start my xampp using user-1 .
I start my application in localhost (localhost/myapplication/index.php)
When I click on button I am executing following command to open pdf:
PHP code:

Code: Select all
$cmdpdf = '"C:\Program Files (x86)\Foxit Software\Foxit Reader\FoxitReader.exe" '.$pdfnameinTempdeudPDF.'';

shell_exec($cmdpdf);

It open PDF for user-1 his current screen using FoxIT Reader.

For user-2

There is no need to start xampp as its alredy started by user-1
I start my application in localhost (localhost/myapplication/index.php)(using different session with login)
When I click on button then its opens PDF in user-1 screen.
Can you please help me in that?
sandytronics11
 
Posts: 3
Joined: 02. October 2015 17:17
Operating System: windows

Re: Issue while opening external program in PHP using apache

Postby Nobbie » 03. October 2015 15:06

That cannot work properly, you have quite problems to understand how HTTP is working. When you call an external program (like FoxIt) in PHP, this is done ON THE WEBSERVER, where Xampp is running, BUT NOT on the client PC (in the browser). And it is executed in the context of the User, which started Apache (the webserver).

I dont know, what you wanna achieve, but i does not work that way.
Nobbie
 
Posts: 13183
Joined: 09. March 2008 13:04

Re: Issue while opening external program in PHP using apache

Postby sandytronics11 » 06. October 2015 11:09

Hello @Nobbie thanks for reply..... I have created application using php with multiple users (multiple users with session can login and use application). In that there is functionality that users can open pdf using foxit reader on server...
sandytronics11
 
Posts: 3
Joined: 02. October 2015 17:17
Operating System: windows

Re: Issue while opening external program in PHP using apache

Postby Nobbie » 06. October 2015 19:20

sandytronics11 wrote:In that there is functionality that users can open pdf using foxit reader on server...


I know, but that does not work for technical reasons. You have to change your application.
Nobbie
 
Posts: 13183
Joined: 09. March 2008 13:04

Re: Issue while opening external program in PHP using apache

Postby sandytronics11 » 26. October 2015 15:58

:( still no solution for my problem..... :'(
sandytronics11
 
Posts: 3
Joined: 02. October 2015 17:17
Operating System: windows

Re: Issue while opening external program in PHP using apache

Postby Altrea » 26. October 2015 18:56

Nobbie already told you that this will not work.
The correct way would be that the server only creates and saves the PDF-Files.
Everything else (like which program opens the PDF) must be provided on the clients PC.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11935
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64


Return to Apache

Who is online

Users browsing this forum: No registered users and 197 guests