Skip to main content
Participating Frequently
February 4, 2010
Question

How do I get past xampp warnings & fatal errors?

  • February 4, 2010
  • 1 reply
  • 4136 views

I am new at creating dynamic web pages and I am experiencing a frustrating situation which entails my inability to view my .php files using xampp as my testing server.  I followed an Adobe tutorial which walked me through setting up my first dynamic page.  This tutorial helped me create a database, as well aslink the database within DW.  The database is "connTest.php."

When I attempted to insert a record (Insert > Data Objects > Insert Record > Record Insertion from Wizard), I followed all the steps and DW created a record; however, when I wanted to view and test the record through a web browser (tried IE and Firefox), the following was displayed:

Warning: require_once(Connections/connTest.php) [function.require-once]: failed to open stream: No such file or directory in C:\xampp\xampp\htdocs\HRConsortium\index.php on line 1

Fatal error
: require_once() [function.require]: Failed opening required 'Connections/connTest.php' (include_path='.;C:\xampp\xampp\php\PEAR') in C:\xampp\xampp\htdocs\HRConsortium\index.php on line 1

I have diligently been looking for a solution on the web and have learned that the testing server is unable to locate the /Connections folder, as well as the /connTest.php file.   I have also read that the issue could be within the php.ini file.  I am uncertain how to get my testing server to see such files / folders.

At this time, I am interested in learning how (a step-by-step would be preferrable) to ultimately get my testing server to view my dynamic pages and allow me to test them for funtionality.  Any assistance would be great!

Thank you!

This topic has been closed for replies.

1 reply

Inspiring
February 5, 2010

When I created my XAMPP installation I did not have

C:\xampp\xampp

My installation is @ C:\xampp\

That could b a problem. Check the folder to see where the htdocs folder is sitting.

What version did you install of XAMPP?

If it was the latest one, its a bit poo.

Make sure your link to Connections is in the correct folder, I know you have checked it, and checked it agian, but strange things do tend to happen some times.

Try using a physical location to Connections folder. Such as require_once C:\xampp\xampp\htdocs\foldername\filename

When you visit the site via a browser do you use http://localhost/HRConsortium/

Your site settings could also be incorrectly set up, go to site ->manage sites -> click on the advanced tab and click on testing server link on the left hand side and check the locations in the two boxes.

Good Luck.

David_Powers
Inspiring
February 5, 2010

The_FedEx_Guy wrote:

When I created my XAMPP installation I did not have

C:\xampp\xampp

My installation is @ C:\xampp\

The latest version of XAMPP asks where you want the files installed. The default is C:\. What the XAMPP instructions fail to tell you is that selecting C:\ actually installs everything in C:\xampp. So, if you tell it to install in C:\xampp, you end up with C:\xampp\xampp.

However, that doesn't make any difference. The Apache server root is either C:\xampp\htdocs or C:\xampp\xampp\htdocs. You just need to use the right one in the testing folder field of the site definition.

What would help in troubleshooting this problem is a look at the OP's testing server definition.

David_Powers
Inspiring
February 6, 2010

Thank you for your suggestion.  I was able to remove the original warnings (outlined earlier in my post); however, when I was finally able to view the record form on the web browser, I went ahead and entered data into the fields and clicked the submit button.  I then came up with the following new warnings:

Warning: mysql_select_db() expects parameter 2 to be resource, null given in C:\xampp\xampp\htdocs\HRConsortium\index.php on line 57


Warning: mysql_query() expects parameter 2 to be resource, null given in C:\xampp\xampp\htdocs\HRConsortium\index.php on line 59

Here are lines of code from my index.php file reflecting the location of the warnings / erros (I provided line numbers to assist):

57 mysql_select_db($database_connTest, $connTest);
58 $query_Recordset1 = "SELECT first_name, family_name, email, phone FROM customers";
59 $Recordset1 = mysql_query($query_Recordset1, $connTest) or die(mysql_error());
60 $row_Recordset1 = mysql_fetch_assoc($Recordset1);
61 $totalRows_Recordset1 = mysql_num_rows($Recordset1);mysql_select_db($database_connTest, $connTest);
62 $query_Recordset1 = "SELECT first_name, family_name, email, phone FROM customers";
63 $Recordset1 = mysql_query($query_Recordset1, $connTest) or die(mysql_error());
64 $row_Recordset1 = mysql_fetch_assoc($Recordset1);
65 $totalRows_Recordset1 = mysql_num_rows($Recordset1);

To address the possible concern of whether I am connected to the server or database, yes.  I tested the connections to both and the tests resulted in successful connections.  When running the tests, I was able to view the existing data in the database.

I attempted, once again, to research the Internet for a possible solution as was unable to locate one.  I would appreciate any assistance.   I have attached a copy of my index.php file to assist in any way.

Thank you


The first line of your script should be including the MySQL connection file. You have this:

<?php require_once('C:\xampp\xampp\htdocs\HRConsortium\index.php'); ?>

It should be this:

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