Fritzbox WLAN Script SomeOneAtHome
When i start the php Script i become this Output:
user@raspberry:~ $ php /home/pi/Presence.php AC:37:43:A0:19:B9
i get this Error in Putty and in Pimatic.
Why is the User “user” and not “pi”? (“user@raspberry:~ $”) you try to run a script in a homedir from a other user… Linux is everytime hard to deal with permissions, maybe there is the Problem?
mabye check it as root, you can switch to root with “sudo su”.
I use the same script and it works fine by me! But i run it over the User “pi” and pimatic also uses the user “pi”.
I have change this to “user” before i post it.
I run the script with user pi too
syntax error, unexpected ‘=’ in /etc/php5/cli/conf.d/20-apcu.ini on line 8
That makes me headache… Can you deactivate apcu module and try again?
Otherwise, how did you create your php file? Can you post your php via paste bin or can you upload you php?
This is my php file:
$uri = “urn:dslforum-org:service:Hosts:1”;
$location = “http://192.168.1.1:49000/upnp/control/hosts”;
$echo = 0;
$client = new SoapClient(
‘location’ => $location,
‘uri’ => $uri,
‘noroot’ => True,
‘login’ => “”,//empty, not needed
’password’ => “”//empty, not needed
$result = $client->GetSpecificHostEntry(new SoapParam($argv,‘NewMACAddress’));
I have php-apcu not installed.
Crazy, i have removed php from my system and start the script as bash.
Now it works.
There is another php version up and running.
this PHP script is running really awesome on my pi v1… thank you for this.
CPU is running nearly 100% now, before was always 3-5% - what did I possibly wrong?
btw: running PHP 5.6.30
Check via console and command top. Check which process really exhaust you cpu. If it’s really PHP then you have a bug in PHP. Normally php don’t need so much power on one user action. By the why post your top here and please tell me which Pi version are you using (1,2,3…) and version of PHP. Also tell me if you use bash on first line and how you execute script.