I am using a local web server (LAMP). When running shell_exec/exec/system with the parameter "/script.py passed_arg[1] passed_arg[2]" there is no return value and nothing happens.
I eliminated permissions by chmod 777, and unreadable file (readdir() came back true).
I eliminated Apache configuration problems (php.ini disable_functions do not have shell_exec/exec and no safemode on).
when trying to run a different script that prints hello everything works fine.
I think it's a problem with the script content. I am using a catkin workspace in ROS, but even when copying the script to /var/www/html/ it doesn't work (running the same exact command in the terminal works perfectly fine).
When commenting out all ros commands (specifically 'import rospy') it works (whatever is left of it).
Script content:
#!/usr/bin/env python
## Simple talker demo that published std_msgs/Strings messages
## to the 'chatter' topic
import sys
import rospy
from std_msgs.msg import String
def talker():
X_Coordinate = float(sys.argv[1])
Y_Coordinate = float(sys.argv[2])
Guest_First_Name = sys.argv[3]
Guest_Last_Name = sys.argv[4]
Office_Name = sys.argv[5]
pub = rospy.Publisher('chatter', String, queue_size=10)
rospy.init_node('talker', anonymous=True)
rate = rospy.Rate(10)
hello_str = "go_to "+ str(X_Coordinate)+" "+str(Y_Coordinate)+" "+Guest_First_Name+" "+Office_Name
rospy.loginfo(hello_str)
pub.publish(hello_str)
rate.sleep()
if __name__ == '__main__':
try:
talker()
except rospy.ROSInterruptException:
pass