Launchd not running php script in background

Hi there,
I am trying to run a php script repeatedly after every 2 minutes using launchd. I am using mac 10.9.2.
Here is my plist file-->
com.mycompanyname.mydepartment.mytaskname.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Label</key>
    <string>com.mycompanyname.mydepartment.mytaskname</string>
    <key>ProgramArguments</key>
    <array>
          <string>/Applications/XAMPP/xamppfiles/htdocs/oauth/job.php</string>
    </array>
    <key>StartInterval</key>
    <integer>50</integer>
</dict>
</plist>
/Applications/XAMPP/xamppfiles/htdocs/oauth/job.php --->
#!/usr/bin/php
<?php 
$File = "YourFile.txt"; 
$Handle = fopen($File, 'a');
$Data = "Jane Doe\n"; 
fwrite($Handle, $Data); 
$Data = "Bilbo Jones\n"; 
fwrite($Handle, $Data); 
print "Data Added"; 
fclose($Handle); 
?>
My command line for your reference-->
studio-film1:oauth MetricFilm$ sudo chmod a+x job.php
studio-film1:oauth MetricFilm$ sudo cp com.mycompanyname.mydepartment.mytaskname.plist /Library/LaunchDaemons
studio-film1:oauth MetricFilm$ sudo launchctl load -w /Library/LaunchDaemons/com.mycompanyname.mydepartment.mytaskname.plist
studio-film1:oauth MetricFilm$ sudo launchctl load -w /Library/LaunchDaemons/com.mycompanyname.mydepartment.mytaskname.plist
com.mycompanyname.mydepartment.mytaskname: Already loaded
When i drag and drop my job.php script on terminal, it shows its path and when i enter.... It is not giving me any error & it is running on command line too & creating "YourFile.txt" if it does not exists & if it exists then it writes two lines into it.
Problem is---->
"YourFile.txt"  is not getting generated neither if it is there is getting written by php script. Which means it is not running into memory even a once.
What should i do to make launchd run this script repeatedly.
Thanking you

Thanks dear,
Should i change relative path mentioned into PLIST file
<string>/Applications/XAMPP/xamppfiles/htdocs/oauth/job.php</string>
to Absolute...?
And is there any other command to start a plist task running after we have loaded it with launchctl??
Thank you

Similar Messages

  • Could not run the script. This command requires an active document.

    Hi,
    I'm receiving a confusing glitch running a batch process in
    FW MX 2004.
    I want to resize images in one folder and export them to
    another. I step through the batch wizard and on commencement of the
    batch receive an error:
    quote:
    Could not run the script. This command requires an active
    document.
    FW is telling me it can't run the commands on empty
    documents, yet the batch is running on all images selected using
    Add All during the batch wizard. Confusing. Similar batches have
    worked fine in recent days.
    Any ideas?
    Thx

    tkatcher wrote:
    > Thank you. Some of them had brackets and percentage
    marks.
    You are welcome.
    E. Michael Brandt
    www.divahtml.com
    www.divahtml.com/products/scripts_dreamweaver_extensions.php
    Standards-compliant scripts and Dreamweaver Extensions
    www.valleywebdesigns.com/vwd_Vdw.asp
    JustSo PictureWindow
    JustSo PhotoAlbum, et alia

  • Have terminal NOT run a script when it loads

    I recently wrote a basic shell script and saved it as a .command file to run from the desktop. Since then, whenever I open the terminal it automatically runs the script then exits the terminal. If I hide the file (mv pt-noplugs.command .ptnoplugs.command) it simply opens the terminal and closes it immediately. I have tried changing the default shell from bash to something else but this doesn't seem to make a difference. I also don't seem to have a .bashrc file when it normally is /home/user/.bashrc (I'm used to linux). Any help would be appreciated. Below is the script:
    # Shell Script to start Pro Tools HD with no waveshell Plug-In
    echo "*"
    echo "* Script: pt-noplugs.command"
    echo "* Please Leave This Window Open Until ProTools Has Exited"
    echo "*"
    # Move waveshell Plug-In Files to Plug-Ins (Unused)
    cd "/Library/Application Support/Digidesign/Plug-Ins/"
    mv -v Waveshell-DAE_5.9.1.dpm "../Plug-Ins (Unused)"
    # Start Pro-Tools
    /Applications/Digidesign/Pro\ Tools/Pro\ Tools\ HD.app/Contents/MacOS/Pro\ Tools\ HD
    # Restore Plug-Ins directory
    cd "../Plug-Ins (Unused)"
    mv Waveshell-DAE_5.9.1.dpm ../Plug-Ins
    echo "*"
    echo "* Thank You. This Window May Now Be Closed"
    echo "*"
    exit

    I forgot to add: when I login as a different user and load terminal is does NOT run the script mentioned before.

  • Startup error message - Could not run this script because of a disk error.

    I uninstalled Dates-to-iCal-Launcher and couldn't find any info about how to uninstall it online (just dragged the icon from Applications to the Trash). Now every time I start my iBook, I get an error message from Dates-to-iCal Launcher (there is an icon that looks like a scroll on the left):
    Could not run this script because of a disk error.
    -43
    How do I get rid of this error message? It happens every time I turn on the computer. Thank you!

    thanks for the update.
    there is no risk when changing settings in any OS user interface like System Preferences etc.
    there could be some risk in manually deleting files from Library folders, which is done sometimes to uninstall applications.
    keep in mind to regularly back up important files.

  • Fireworks (cs3) could not run the script

    When I choose in adobe dreamweaver: command->create web
    photo album fireworks (fw) is launched. The problem is that when fw
    is launched I got the following message: "Could not run the script.
    The file was not found." So the result is a webpage without
    pictures and thumbnails.
    What can I do?
    Thank you for your answer in advance,
    sz.g.

    [AM] I wonder if this could be related to your InteliMac?
    I'll try and repro the problem you are experiening.
    Alan I do believe the problem is directly related to the
    IntelMac issue with DW & FW having to run in Rosetta.
    Unfortunatly the Adobe document FAQ Adobe Support for
    Intel®-based Mac computers
    http://www.adobe.com/products/pdfs/intelmacsupport.pdf#search=%22adobe%20studio%208%20not% 20supported%20intel%22.
    in the section "Are there any known issues with running Adobe
    Creative Suite 2, Studio 8, or After Effects 7.0 under Rosetta?"
    doesn't say anything about the Web Photo Album command not working.
    I upgraded to Studio 8 in mid August because when I upgraded
    to an InteliMac I found that the FTP in my older DW MX application
    would crash the application and obviously that would make working
    on any websites sort of difficult. So I upgraded to Studio 8 and
    everything was running fine (albeit slow at times) until about
    three weeks ago now when a web site I was working on for a client
    called for Web Photo Album and I discovered this problem.
    It also turns out that I happen to like using the JustSo
    Photo Album extension but it failed in the same way so it must call
    on Fireworks in the same way that Web Photo Album does.
    [AM] You could try this Slideshow Creator extension for
    Fireworks:
    Thanks for that tip. Is the Slideshow Creator your creation?
    Unfortunalty I needed a "Photo Album" and not a slide show so I
    ended up using Galerie (
    http://www.myriad-online.com/en/products/galerie.htm)
    but I like the idea of a slideshow too.
    I downloaded and tested your Slideshow Creator Extension and
    ran a quick test and I like it but for one thing. The album page it
    created had all the thumbnail images bunched up in the upper left
    hand corner. I don't know whether that was something I did or
    failed to do in setting up the output or is it another InteliMac
    with Fireworks? I'll have to take another look at it this weekend
    when I have some extra time.
    Thanks again for the tip.

  • Tried to load wordpress but got error message that it was not running php, can it, and if so, how

    Tried to download "WordPress" thru Firefox, but got an error message that my Firefox was not running php. Can Firefox run php, and if so, what do I do to make it happen?

    its loading fine on my system and i don't have any special Add-on or Plugin installed specifically for it :-P
    However see this post:
    https://support.mozilla.com/en-US/questions/782622
    Check and tell if its working.

  • RUNNING PHP SCRIPT WITH ZEND FRMWRK IN WINDOWS TASK SCHEDULER

    I have a PHP script which includes the Zend framework Mail.php for sending mails.
    I am running a WAMP server and i used DW to create it.
    I want to run my script in every 5 mins, How i can schedule it in Windows task scheduler.
    I tried running a bat which contains the php.exe path and arguments as php file but it gives an error that zend/mail.php not found.
    Please help its really urgent.

    Thanks for your response.
    bat file has:
    path of the php.exe -f path of php file.
    But when it runs it gives an error that the zend framework file not found.
    I have a seperate PHP includes folder under which zend FW is stored.
    That folder is marked in includes_paths in php.ini.

  • Need to run php script before the Flash component kicks in

    I have a slide show component in Flash which uses an xml file to load images. The xml file, however, is created dynamically when the user selects which slide show they want to see. How do I run the php script BEFORE the slide show component has a chance to look for it? Usually it begins as soon as the .swf is run.
    thanks,
    chop

    thank you for responding.
    I'm still new at as3 so forgive me for needing details.
    I searched adobe for help and came up with the following to import the component. However, it seemed too easy to be true and so it was. I received errors when I ran it. The component is a commercial one called SlideshowBox and is in my library with that exact name.
    //add a component to the stage
    import fl.controls.SlideshowBox;
    var aSlideshowBox:Button = new Button();
    addChild(aSlideshowBox);
    errors:
    Scene 1, Layer 'Actions', Frame 1, Line 3    1172: Definition fl.controls:SlideshowBox could not be found.
    Scene 1, Layer 'Actions', Frame 1, Line 3    1172: Definition fl.controls:SlideshowBox could not be found.
    Scene 1, Layer 'Actions', Frame 1, Line 4    1180: Call to a possibly undefined method Button.
    thank you, k

  • Run PHP script

    Hello, everybody. I'm wondering if it's possible to run a HTML PHP script in a report region which type is HTML format? Something like:
    <?php
    echo phpinfo();
    ?>
    As I can imagine, this code could not be handled to PHP compiler although as I know, the ORACLE appication server has been compiled together with PHP 5. So is there any tricks to make this work, or does APEX have some plan to make similar things work in the later version?
    Thanks!

    I have a PHP application that opens up a template (MS
    Word) invoice file, inserts some information in the
    file (eg. today's date, customer name) and then saves
    it as a new Word file. My questions are as follows.
    1- How can I call this script from my Java
    application. Please note that I want to be able to
    pass parameters (eg. custome name read from a DB) from
    my Java app. to this script.You would have to call the PHP interpreter through Runtime.exec(), I believe. I haven't done anything with it, but you would have to build the command that would normally be typed on the command line as a string and pass it to Runtime.exec().
    2- Is it possible to print already saved MS Word
    documents from Java? If so, how?Try looking at the Jakarta POI project.
    3- Is it possible to do what my PHP script is doing in
    pure Java? I couldn't find a simple way of doing this,
    that's why I used PHP but I would like to do this in
    Java if I can.Same as 2.

  • Run PHP script in Java app.

    Hi,
    I have a PHP application that opens up a template (MS Word) invoice file, inserts some information in the file (eg. today's date, customer name) and then saves it as a new Word file. My questions are as follows.
    1- How can I call this script from my Java application. Please note that I want to be able to pass parameters (eg. custome name read from a DB) from my Java app. to this script.
    2- Is it possible to print already saved MS Word documents from Java? If so, how?
    3- Is it possible to do what my PHP script is doing in pure Java? I couldn't find a simple way of doing this, that's why I used PHP but I would like to do this in Java if I can.
    thanks in advance,
    Mete

    I have a PHP application that opens up a template (MS
    Word) invoice file, inserts some information in the
    file (eg. today's date, customer name) and then saves
    it as a new Word file. My questions are as follows.
    1- How can I call this script from my Java
    application. Please note that I want to be able to
    pass parameters (eg. custome name read from a DB) from
    my Java app. to this script.You would have to call the PHP interpreter through Runtime.exec(), I believe. I haven't done anything with it, but you would have to build the command that would normally be typed on the command line as a string and pass it to Runtime.exec().
    2- Is it possible to print already saved MS Word
    documents from Java? If so, how?Try looking at the Jakarta POI project.
    3- Is it possible to do what my PHP script is doing in
    pure Java? I couldn't find a simple way of doing this,
    that's why I used PHP but I would like to do this in
    Java if I can.Same as 2.

  • Can not run shell script

    Hello firends,
    I have one simple script to run orbd and one java program: I can not this script on RH linux.
    #!/sbin/sh
    case "$1" in
    'start')
    /bin/orbd -ORBInitialPort 2600 &
    sleep 5
    /bin/java NamdServer -ORBInitialPort 2600& --------This can not run.
    echo "Server is up."
    'stop')
    echo "Usage: $0 { start | stop }"
    exit 1
    esac
    exit 0
    I cound not see the process of "java NamdServer" using ps -lef after run this script. I also tried the following option with -classpath, it did not work either.
    java -classpath /disk/programs/namd_server_sparc/:. NamdServer -ORBInitialPort 2600
    java -classpath . NamdServer -ORBInitialPort 2600
    Thanks a lot.

    Hi
    When you try to execute the NamdServer do you get any output as it tries to start ? or does it fail
    silently?
    You might need to try and find out if you can run NamdServer in a verbose mode where it tells you whats its
    trying to do.
    Alternately. you can use the truss command ( man truss to find out more ) on your script.
    regards

  • Securely deploying and using credentials within a script (not running the script under the credentials)

    Here is my scenario - I have SCOM 2007 R2 and on certain agents I want to execute a script. One of the actions of that script is to access a secured web page using a username and password via integrated authentication (IE pop-up for auth).
    The username and password that I need to use are unrelated to the Windows domain that the servers run in, meaning you can think of the website as if it were a public site (it isn't, but it has no security sharing with the domain where the agents run - no trust,
    no nothing).
    I can easily accomplish this by hard-coding the username and password within the script (powershell), however, I don't want to do this for security reasons. Here's a rough example of the relevant code:
    $targetURL = "https://somehost.somewhere.something/filename.zip"
    $path = "c:\downloads\filname.zip"
    $wclient = New-Object System.Net.WebClient
    $wclient.Credentials = New-Object System.Net.Networkcredential($uname, $pword)
    $wclient.DownloadFile( $url, $path )
    What I want is a way to pass the $uname and $pword variables to this script securely, with the script running on a schedule under SCOM. The SCOM agents run as localsystem and need to remain that way.
    I currently use Run-As accounts and profiles for other functions where the entire script runs under the run-as profile, but I can't figure out how to extract the username and passwords, and doubt it's even possible.
    To be clear, I cannot run the script under the given credentials as a Run-As account as those credentials are not known to the local server. I need to somehow pass the credentials to the script (other than hardcoding) or extract them from the run-as accounts.
    I've looked at the get-runasaccount cmdlet and can see some of the info there, but don't see a way to re-use, pass-through, or extract the password for use in my scenario.
    Any guidance? Can I get there from here?

    Hi, check this
    http://social.technet.microsoft.com/Forums/windowsserver/en-US/ebfc706d-93be-4ca0-83e0-33d9e072fb97/powershell-script-monitor-with-encrypted-password?forum=operationsmanagerauthoring
    But you should not specify runas account for your workflow, just reference Runas Username and Password from Profile and use simple authentication. (The same way as in article above)
    So in the end your script will be executed by default action account but you'll pass username and password securely to your script.

  • Running PHP Script

    I've enabled the Apache server on my mac, and when I access my local IP address I can see the web page I've created. However, it appears that the server doesn't process PHP scripts, and just returns the source code of the PHP script when I try to open the script in Safari 4. How do I get the built-in Apache server to process PHP scripts and return the desired result?

    PHP is disabled by default. To enable it, you must edit Apache's configuration file. To do this, open up /private/etc/apache2/httpd.conf with a text editor. The file is owned by root, so you'll need appropriate access to modify the file. Text editors like BBEdit or TextWrangler can make this step much easier.
    Fairly early on in the configuration file is the section for the Dynamic Shared Object support - these are the modules that Apache loads to enable it to perform various tasks. In this section are a whole bunch of "LoadModule" statements - one for each module that Apache is loading. One of these is for PHP support. In the httpd.conf file on my machine, the built-in PHP module's statement is on line 114, the next to last item in this section. It reads: "#LoadModule php5_module libexec/apache2/libphp5.so" Remove the "#" from the beginning of the line, save the file, and restart Apache.
    If you plan on using PHP files as the default page for a directory (index.php, for example), you'll need to add index.php to the Directory Index section (line 225 in my file). Apache looks for them in the order listed, so if you list index.php after the index.html that's already there, Apache will look for index.html when asked for the directory before looking for index.php. If you're going to have index.php for most of your directories, you may want to list it first, before index.html.
    With regard to PHP itself, Apple's included PHP isn't any more official that the one I mentioned from Marc Liyanage. They're both compiled from the same source code. And, as far as updating goes, I'd argue that it's easier to update Marc's version, as you simply download an updated version and the installer will overwrite the old version. And, you don't have to wait for Apple to release a new version of OS X or a security update to see if you get a more current version. His versions will almost always be more current than the one Apple provides.
    In any event, Marc's version does not remove Apple's version from your system. His installs in /usr/local/ and leaves Apple's version intact. So, you can always go back to Apple's version by changing a few lines in a configuration file.

  • Running PHP script from Java apps

    Hi,
    I have a PHP application that opens up a template (MS Word) invoice file, inserts some information in the file (eg. today's date, customer name) and then saves it as a new Word file. My questions are as follows.
    1- How can I call this script from my Java application. Please not that I want to be able to pass parameters (eg. custome name read from a DB) from my Java app. to this script.
    2- Is it possible to print already saved MS Word documents from Java? If so, how?
    3- Is it possible to do what my PHP script is doing in pure Java? I couldn't find a simple way of doing this, that's why I used PHP but I would like to do this in Java if I can.
    thanks in advance,
    Mete

    Don't reply here. Go here instead.
    http://forum.java.sun.com/thread.jsp?forum=54&thread=479160&tstart=0&trange=15
    Cross-listed
    Sorry, I thought this didn't post before.

  • Running php scripts on development server

    Hi,
    I have Coldfusion development server and Apache running on my local host. CF is on port 8500 and Apache is running on port 80.
    On my remote host in plesk I can add support for Coldfusion and PHP, is there a way to run PHP files on localhost:8500?
    Thanks

    Sweet. I run this setup on Mac 10.5.7 and it's great (PHP & CFML on port 80, that is).
    The easiest solution is to reinstall CF as a multi-server and run the connectors for Apache. The most recent CF (8.0.1) Mac installer is 'built' for Leopard, so it works well.
    Mark Drew has a good post:
    http://www.markdrew.co.uk/blog/post.cfm/running-coldfusion-8-on-leopard
    Aaron West also has an excellent post on CF 8 & Leopard:
    http://www.trajiklyhip.com/blog/index.cfm/2008/1/14/ColdFusion-8-Apache-22x-and-OS-X-105-L eopard
    If you run into a snag, PM me & I can help more (I've freaking installed this $%&@ thing so many times )!

Maybe you are looking for

  • Have I made a mistake buying an Core Duo?

    Hi Am I doomed, Have I commited a crime, Am I going to be dissapointed? I am getting worried here, as I sit glaring onto the screen of my new Intel Core Duo 20", and staring even harder at the lovely black box of my Motion 2 Software which I can't do

  • Macbook pro hdmi problem

    Hello guys and girls I have a problem, when i connect my macbook pro to my sony TV its shows video and sounds as it should. but when i close the lid on the mac it dissapears and goes into blackscreen as  nothing is connected, and no matter what i do

  • Kernel Panic Error on Macbook Pro 2011

    Hi everyone, I have had this error which causes to restart my macbook pro regularly and tried to do the steps provided from apple support but no luck!.I have attached my kernel panics logs. I just clean installed my OSX Mavericks and when i opened th

  • How do i transfer existing pics to my new icloud

    How do I transfer existing photos from my iphone 5c to the icloud i just opened

  • Updating iphoto 9.4.3 issues

    having problems updating iphoto 9.4.3. everytime i tried downloading it ...it will download at first and then at the end it will give an error message (error has occured)