Skip to content

Tag: php

Trying to run python script in PHP

I’m trying to run a Python script inside a perl script with the following command: On the operating system’s command line, the Python script executes, but when I make a call from a PHP application, the perl work, but the python script don’t work. Answer Do you get any error message from Perl…

rrd_fetch does not contain values from last update. why?

I am storing information from temperature sensors in a rrd. I want to retrieve the values from a given timespan in php. For data from the last 2 hours, I use this: This is working. However, the last value that I can get via rrd_lastupdate($file); is not found in the data from rrd_fetch. How can I adapt my cod…

AES encrypt in python decrypt in php

I am asking this because I don’t really know php but must to somehow manage with. I have encrypted data in python and need to decrypt in php (serversite). python encryption: this gives ‘rtVabOaDdf528T63xOhhww’ output, which is correctly AES encrypted. and php which encrypts and decrypts in o…

Python PHP equivalent

I have been using PHP for a while now with my Apache2 web server on my raspberry pi. It works great, but I get tired of always having to think “how do I X in PHP” or “what was the function name for this in PHP”. I am under the strong impression that there should be something equivalent…

GET Access token from API (oauth2)

I am very beginner at Python scripting and i have a problem. I am trying to rewrite PHP code to Python to get Access token from API for further use. This is what i am trying to do in Python. My Python code is: but this is not working Python is returning: I know that i am missing everything from

unpacking an array of arguments in php

Python provides the “*” operator for unpacking a list of tuples and giving them to a function as arguments, like so: This is equivalent to: Does anyone know if there is a way to achieve this in PHP? Some googling for variations of “PHP Unpack” hasn’t immediately turned up anythin…