Noob PHP Error question

software development

#1

Sirs:

I am trying to write a simple “hello world” sort of PHP script to display data from a database on my domain. You can see it at http://redneckstemware.com/datatest.php

I am using Dreamweaver to do the development, and everything works fine locally, including accessing the data on my domain… but when I try to run the script on the website, I get the following errors:

—begin errors—
Warning: main(Connections/dbtest.php) [function.main]: failed to open stream: No such file or directory in /home/.kylie/dhrednecks/redneckstemware.com/datatest.php on line 1

Fatal error: main() [function.require]: Failed opening required ‘Connections/dbtest.php’ (include_path=’.:/usr/local/lib/php’) in /home/.kylie/dhrednecks/redneckstemware.com/datatest.php on line 1
—end errors—

The line that raises the error, the first line of the script, is:

<?php require_once('Connections/dbtest.php'); ?>

It was inserted by Dreamweaver.

I presume (hope) that “require_once” is some sort of built-in PHP function, and that there is a library of such functions that I need to enable by putting something in my script. Some sort of an “include” or something.

Much gratitude for any help that can be offered.

Regards,

Steve Jones


#2

You should probably look at these two articles on the DreamHost Wiki:

  1. MySQL and PHP
  2. Allow_url_fopen (section on Server-Side Includes)

Simon’s website
Save $100 on 1-year plans with promo code [color=#CC0000]SCJESSEY100[/color] (details)


#3

require_once is PHP build-in function. It is used to import an external file to the page.

It can’t be inserted by Dreamweaver. You should be the one who inserted the codes. If you do not need to import dbtest.php file, just remove the codes from your page.

BTW, the page dbtest.php does not exist in your server.

Save [color=#CC0000]$97[/color] (max discount) on dreamhost plans by using promo code: [color=#CC0000]97CRAZY[/color].