Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 5091

Python • Re: Running python script from PHP - crashes at "import mysql.connector"

$
0
0
I should have given more info at the start: The OS is Raspbian Linux 11 (bullseye).
I installed using Thonny's 'manage packages menu option which i understand calls pip to install mysql-connector-python 8.4
To be honest I dont know whether this route would make it available system wide or just for my user account.
The php script is also running on the Pi

As an aside, frustrated by my lack of progress I decided to write the values from the php form to a text file and then open this in python and open/close the relay switches by reading the values in python from the text file. I hit a similar issue in that the python script silently crashed on the line GPIO.setup. Searching forums i ended up adding www-data to the dialout group and that 'worked'. So i am now thinking that perhaps I do have a permissions issue with mysql.connector afte all but I really dont know what/where to look next.

Any guidance would be appreciated.

Statistics: Posted by Julian62 — Wed Jul 03, 2024 7:33 am



Viewing all articles
Browse latest Browse all 5091

Trending Articles