Noob PHP Error question

Noob PHP Error question

Posted by: dhrednecks
Posted on: 2007-02-07 15:12:00

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

Re: Noob PHP Error question

Posted by: scjessey
Posted on: 2007-02-07 15:26:00

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)

Re: Noob PHP Error question

Posted by: nathan823
Posted on: 2007-02-07 16:47:00

In reply to:

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


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

In reply to:

It was inserted by Dreamweaver.


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.




Tags: line 1noobusing dreamweaversimple hellophp errorhello worldphp functionopen streamphp includephp scripttry to runfatal errorlocallylibusr