So has anybody successfully gotten PHP to run through the CGI-BIN on your personal webspace? I kinda have it goin', but it throws out a whole lot of undeclared variable errors. The scripts run great on my linux box at home, but won't work thru CGI.
Any suggestions?
_________________ "...whatever you hear, stay away - John Doe has the upper hand..." "...he shot him...somebody call somebody..."
make a public_php directory in the same directory as your public_html directory and set the appropriate permissions then throw your scripts in there. When you call the scripts use: http://acmphp.cs.umr.edu/~userid/script_name.php
In your public_html folder make a folder named cgi-bin. Put your scripts in there. Then you have to access your website through gpunix1.cc.umr.edu/cgi-bin/cgiwrap/userid/script_name.php
There is no tilde in front of your userid.
Also, you have to put "#!/umr/testbin/php --" at the beginning of the file.
Ok, that's the method I was told by IT. When i run cgiwrapd, it outputs a whole string of variable errors:
Output of script follows:
=====================================================
PHP Notice: Undefined variable: r in /afs/umr.edu/users/rasnqb/public_html/cgi-bin/index.php on line 58
And I get those two lines for every time I use a variable in the script with different line numbers lol.
What's up wit that?
_________________ "...whatever you hear, stay away - John Doe has the upper hand..." "...he shot him...somebody call somebody..."
You can put that at the top of your php files. You can edit the arguments to change which errors get output to the screen. This is pretty much a requirement for new versions of PHP. You can get around this if you propperly configure your php.ini which umr will not do.
Since I code php for a living (a sad living) I might give you some advice. I would put this in a seperate file that holds all of my global variables and global functions... if your code is complex enough to need this. Then you simply include that file into your other php files.
like:
include 'secure.php';
These are just some sample snippets from some code I've written. Hope that helps. Goto php.net and look at their documentation too.
Users browsing this forum: No registered users and 2 guests
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum