OT: How to embed or call a shell script in an html file?
Matt Graham
danceswithcrows at usa.net
Tue Jun 25 08:46:24 MST 2013
From: joe
> I have tried everything that you suggested, but I still can't get
> the code that you gave me to work.
>> If your web server is running PHP ...
> It is. I have other .php programs on my web host's server that
> work fine.
So it's a shared host, possibly with a config that's disabled some things or
enabled other things. If "safe mode" is enabled, you can't use ``. I asked
for the output of phpinfo() earlier; that'd be a great place to start.
>> all you should need to do is copy all the stuff
>> Then, going to http://yoursite.example.com/search.php
>> should show you a simple form with 2 fields and a "Go" button.
> I have done that, but I get this error message:
> "[an error occurred while processing this directive]"
> No other details or info.
That error usually means a bad SSI directive, not anything to do with PHP.
Did you look at the error logs? Are any error logs available?
> Yet I do have other .php programs running and working fine
So it's something with that code. Does "php -l thatfile.php" return any
errors? That very useful command runs a syntax check on PHP code. I use that
all the time to make sure I haven't left a ; or ) off.
>> Apache with PHP enabled typically has 2 lines in its config file
>> LoadModule php5_module modules/libphp5.so
> I don't know where to find that libphp.so
It shouldn't be necessary to change that if other PHP code is working.
I would guess that your webhost has safe mode on, but I don't know for sure.
You won't be able to execute shell from PHP if that's the case. It'd be
possible to replicate what you want without using shell by using preg_match(),
naturally. This would require learning more PHP and using that instead of
shell though....
--
Matt G / Dances With Crows
The Crow202 Blog: http://crow202.org/wordpress/
There is no Darkness in Eternity/But only Light too dim for us to see
More information about the PLUG-discuss
mailing list