I program a python script with selenium, I launch my script from a php website, when I launch it from my PC locally I manage to launch geckodriver, but when I am on my xampp server, I get this message:
error: Service ./selenium/geckodriver/mac64/0.34.0/geckodriver unexpectedly exited. Status code was: 64
I put python in my server as well as selenium so that all the paths are relative but that doesn't change anything, here is my python script:
from selenium import webdriverfrom selenium.webdriver.firefox.service import Servicefrom selenium.common.exceptions import WebDriverExceptiongeckodriver_path = "./selenium/geckodriver/mac64/0.34.0/geckodriver"firefox_binary_path = "./selenium/firefox/mac64/123.0.1/Firefox.app/Contents/MacOS/firefox"service = Service(executable_path=geckodriver_path)options = webdriver.FirefoxOptions()options.binary_location = firefox_binary_pathtry: driver = webdriver.Firefox(service=service, options=options) print("Firefox browser started successfully!") driver.get("https://www.example.com")except WebDriverException as e: print("An error occurred while starting the Firefox browser: ", e)and here is my php code:
<?php// set read access to all filesif ($_SERVER['REQUEST_METHOD'] === 'POST') {// $username = 'noabacle';// $command = ' /Library/Frameworks/Python.framework/Versions/3.12/bin/python3 /Users/noabacle/Desktop/main2.py 2>&1';// $command = ' /Library/Frameworks/Python.framework/Versions/3.12/bin/python3 ./web/test.py 2>&1';$command = ' ./Python.framework/Versions/3.12/bin/python3 ./web/test.py 2>&1';$output = shell_exec($command);echo "<pre>$output</pre>";}?>I don't know what to do anymore knowing that it's not a version problem, it works when I'm local.
I tried to update the versions, to put the files in relative, to set the rights to all the users but nothing worked...