PHP Script

apps

#1

Hi,
I wondered if anyone had any suggestions on getting a php script to work on dreamhost. First off, I have to admit, I know little to nothing about php. I bought a software package called Traffic on Steroids which is a php based article rotator. The programmer for this product has tried to get it to work, and although everything looks good as far as php running as html, he can’t get the script to read the control .ini file. I don’t know if anyone would have any suggestions to pass along, but I thought I’d ask. From what I’ve been told, this is the first time they’ve been unable to get it to work on a hosting service. Thanks for the help.
Mark


#2

PHP works fine on the servers. Try a basic script like

<?php echo "Hello World"; ?>

to prove the point. Then try this script

<?php if(@include("insert_name.ini")){ echo "included file"; } else{ echo "not included file"; } make sure this script is in the same directory as the ini file. See if that works, if so, there is a problem with your new program. It could be a database problem, if it uses a database.

#3

Hi,
Mark here again. Thanks for the advice. I tested the hello world script and as you noted, all worked fine. Put the other script in the suggested directory and no change, it still didn’t work.

Supposedly this script has worked well on a lot of hosts, only a few where it has not. Your right on though about the fact that for some reason, the script is not properly pulling from the database. Everyone (even those more knowledgable than me are stumped) Thanks again for the help.

FYI…here’s the error code I get back from the script on the page…
Warning: main(…/test.txt): failed to open stream: No such file or directory
Warning: main(): Failed opening ‘…/test.txt’ for inclusion (include_path=’.:/usr/local/lib/php’)
If anyone with experience with dreamhost has any ideas? Many Thanks,
Mark


#4

I think the problem is with the include path… it looks like it’s trying to include from /usr/local/lib/php… it should be trying to include from your site…

Try going to your admin panel, Domains->Manage, select the Web aspect to your domain and click Edit next to it, then untick the “Run PHP as CGI?” and “Extra Web Security?”. See what happens. You will probably have to wait for a while. If you are in Europe area, then it’s night time so just save the changes and see what happens in the morning.

If you are getting information from the database, including test.txt won’t affect that. It seems your problem is trying to include files. Did you take my suggestion and just put that test file at the same level as your text file (ie same folder
(and renaming the

if(@include(“insert_name.ini”)){

to
if(@include(“test.txt”)){

))?

I’ve not had any problems including files, my own web site includes about 5 files every time it’s loaded…