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

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

$
0
0
I managed to fix this in the end and post what I did here in case it helps others. I decided to test my php script from the command line logged in as my daytoday user first with and without sudo. Without using sudo my script 'worked' in the sense that it did not silently crash on the line 'import mysql-connector' I then ran it with sudo and it failed.

So i uninstalled the mysql-python-connector through Thonny and reinstalled it for all users using sudo pip3 install packagename. My php script now works from a browser and the command line.

Thankyou @B.Goode for giving me a clue.

Julian

Statistics: Posted by Julian62 — Wed Jul 10, 2024 6:43 am



Viewing all articles
Browse latest Browse all 4829

Trending Articles