Jump to content

Recommended Posts

I want to display images.  LOCAL IMAGES.  We can argue about all the reasons to "download the files from the server" and all the other extraneous stuff, but right now I need to know HOW to do this...

 

In php I figure out what files should be in the show and create a file with the list.  Irfanview has a command line option so it'll start up and display the local files.  It looks like:

 

c:\xampp\htdocs\i_view32.exe /slideshow=xxx.txt

 

Open a Windows command window, put in the text, and it works PERFECTLY......

 

HOW do I do this from php?  I found the "EXEC" command, and tried:

 

$status=exec ("c:\xampp\htdocs\i_view32.exe /slideshow=xxx.txt");

 

and I get activity, but no Irfanview popping up and running...

 

What DO I need to do to get this to work?

It may be that you are not escaping the slashes.

 

$status=exec ("c:\\xampp\\htdocs\\i_view32.exe /slideshow=xxx.txt");

 

Give that a try and see if it yields some results. Just a note, this will only work on your server, if the server is on your local machine and that is what you want, it should work properly.

Tried the line, which is one I've tried before.  I get the "loading" message and spinning indicator, but nothing ever comes up......  It doesn't get much simpler than this example, so what's going on?

 

<?php

$status=exec ("c:\\xampp\\htdocs\\i_view32.exe /slideshow=xxx.txt");

?>

 

Without knowing what i_view32.exe does and what the expected results should be, best guess is that you need to go into the Apache service under the Windows service control panel and check the "Allow service to interact with desktop" checkbox and restart the Apache service.

Let me switch to a (hopefully) more generic example:

 

<?php

$status=exec ("notepad.exe");

?>

 

which I PRESUME should just run notepad.... 

 

Unfortunately, you lost me with the "go into the Apache service under the Windows service control panel and check the "Allow service to interact with desktop" checkbox and restart the Apache service."

 

I'm running xampp, so I'll have to figure out how to get into the Windows service control panel and all that....

 

OK, found the thing in services to tell Apache to interact with the desktop.......

 

Shut everything down and restarted.......  When I run the php, instead of getting a notepad window I just get "loading" and nothing happens.......

 

What am I missing?

Can you elaborate on that?  Isn't "my computer" the client?  It's a single laptop that'll have the software running locally...  So, again, still have the same problem....  Even WITH the full path I can't get Notepad or Irfanview or

anything else to come up and run normally.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.