"Premature end of script headers" bugging me
hi
im running apache on red hat 9 and im trying to run a few scripits through PHP but im getting errors
when i run the script from a browser i get a internal 500 error and the error log tells me that i have "Premature end of script headers"
i presume this is an error regrading the structure of my script so ill post it here
#!/bin/sh
# change: this script read the ip address of the user accessing the web page and matches it with it's MAC address.
#This MAC address is then sent a script called add, which allows it onto the network
read ip_address
IPTABLES=/sbin/iptables
sudo arp > /root/lankfordu/apache/logs/users.txt
sudo awk '{if ($1 == "'"$ip_address"'") print $3}'
/root/lankfordu/apache/logs/users.txt | /root/lankfordu/apache/cgi-bin/add
sudo $IPTABLES -t nat -A POSTROUTING -s $ip_address -j MASQUERADE
when i run the scripts from the command line i get ": bad interpreter: No such file or directory"
so anyideas!!? hope i gave enough info and i have the default test-cgi working so i dont think its anything to do with my httpd.conf file
also what is the best way to call this script from php
at the moment i have echo "'$REMOTE_ADDR' | /root/lankfordu/apache/cgi-bin/change";
but i dont think that will work
cheers
|