A
A
Alex2015-01-27 16:33:49
PHP
Alex, 2015-01-27 16:33:49

How to create shortcut in php script?

There is a certain php script that requests information from a remote server and outputs it using notify-send.
Run from console:
[email protected]:~$ php ~/patch/my.php
Inside:

shell_exec('notify-send "Мой скрипт" "'. $result .'"');

I decided to create a button for a quick launch. Google prompted instructions
However, there was a problem: When you click on the button, the script is launched, but notifications do not appear.
It 's the same if you run the command via cron
. What's the problem? Which way to look?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey Shein, 2015-01-27
@Kozack

Are you sure it's running? notify-send is supposed to be set globally and should be visible from everywhere. Check with normal bash script:

#!/bin/bash
notify-send hello

You just need to remember to give the right to execute:
$ chmod +x hello.sh

M
Max, 2015-01-27
@AloneCoder

rus-linux.net/MyLDP/consol/alias.html

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question