Jump to content

Execuatble php file


Nodral

Recommended Posts

Hi all

 

I am trying to automate a process and need to know if it is possible to create an exe file which will run a php file for me.

 

I've had a bit of a google, but as I don't understand command line stuff, I'll struggling to mae head nor tail of it.

 

Any help would be appreciated.

Link to comment
https://forums.phpfreaks.com/topic/245108-execuatble-php-file/
Share on other sites

If You are using Windows, you could create a batch script to run the php script for you. I'm a little rusty on it but if you open up a new file, paste this:

 

@echo off

php "C:\Path_to_your_script\script.php"

 

and save it as a .bat file, you can double click it and it will run. Just make sure you have PHP installed.

Link to comment
https://forums.phpfreaks.com/topic/245108-execuatble-php-file/#findComment-1258998
Share on other sites

I've tried this, and it runs fine when double clicked.

 

However, I am trying to set it up as a rule in Outlook to perform an action when I receive an email each day.  There is an error appearing in the command window but it pops up and closes so quick that I have no idea what the issue is.

 

Any ideas how I can either slow it down, keep the window open or another method?

Link to comment
https://forums.phpfreaks.com/topic/245108-execuatble-php-file/#findComment-1259007
Share on other sites

Essentially what a .bat file does when it is run, is takes each line and runs it as a command in command prompt. What you could do for testing is just open up a command prompt window (Start > All Programs > Accessories > Command Prompt) and paste the line:

 

php "C:\Path_to_your_script\script.php"

 

The command prompt window will stay open so you can see any error that is reported. If you see any errors you can post them and I can try to resolve them.

Link to comment
https://forums.phpfreaks.com/topic/245108-execuatble-php-file/#findComment-1259013
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.