Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How do I get past xampp warnings & fatal errors?

New Here ,
Feb 03, 2010 Feb 03, 2010

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!

TOPICS
Server side applications
4.1K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Feb 05, 2010 Feb 05, 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 05, 2010 Feb 05, 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 05, 2010 Feb 05, 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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 06, 2010 Feb 06, 2010

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'); ?>
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 06, 2010 Feb 06, 2010

Thank you for your suggestion.

In reviewing your posting, if I should replace my first line of script to reflect, <?php require_once('Connections/connTest.php'); ?>, then I will end up with the original warnings the testing server returned (see my original post).

As I stated earlier, there appeared to be a conflict with the testing server finding the ('Connections/connTest.php') location.  I reviewed in another blog that it may be necessary to create a "Connections" folder within xampp and then create a "connTest.php" file and insert into the "Connections" folder in order for xampp to connect to that location.  So, in response to that blog, I created a Connections folder and connTest.php file.  However, that action had not affect.  I ended up with the same warnings (see warnings in my original posting).

In any case, as you saw in my previous posting, I replaced the ('Connections/connTest.php') with ('C:\xampp\xampp\htdocs\HRConsortium\index.php') and that it appeared to eliminate the warnings; however, it created another problem and reveled conflicts with the mysql_select_db and the mysql_query scripts:

(mysql_select_db($database_connTest, $connTest);

$Recordset1 = mysql_query($query_Recordset1, $connTest) or die(mysql_error());

If you're able to provide some insight, your time and expertise would be much appreciated.  Thank you for all you have done so far!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 06, 2010 Feb 06, 2010

This is a very simple issue that should have been sorted out in minutes. As I said in my first reply, what would help in resolving this problem is a look at your testing server definition. That's where the error lies, not in any code that has been created by Dreamweaver.

Looking at your various posts, the values in the Testing Server section of your site defintion (use the Advanced tab) should be as follows:

Server model: PHP MySQL

Access: Local/Network

Testing server folder: C:\xampp\xampp\htdocs\HRConsortium\

URL prefix: http://localhost/HRConsortium/

Use those settings, and the original require_once('Connections/connTest.php'); will work.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 06, 2010 Feb 06, 2010

Once again, thank you for your reply.

This may frustrate you.  After reviewing the definitions you outlined in your last posting, I was able to verify that my definitions were exactly the same (see attached Word Document).

It would be my understanding that if my definitions had errors, would I be able to connect to the testing server or even connect to any my databases?  In any case, I am still having trouble.

I event tried the same process in another site I am working on and I still came up with the same errors as before...

Warning:  require_once(Connections/connTest.php) [function.require-once]:  failed to open stream: No such file or directory in C:\xampp\xampp\htdocs\persacare\test.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\persacare\test.php on line 1

Is there no hope?  Could my version of xampp be the problem?  I downloaded and installed XAMPP Windows 1.7.3  from apache friends.  I am also running xampp on a Windows 7 OS x64 bit.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 07, 2010 Feb 07, 2010

Right, I can see your testing server definition is correct. By the way, you don't need to attach screenshots in Word documents. Just use the camera icon in the reply box to embed an image in your reply. It makes it easier for everyone.

The fact that you're running XAMPP 1.7.3 on Windows 64-bit makes no difference. The error message is telling you that the file is not in the expected location, or that it can't be opened.

The next thing to check is where you are storing your local files. Are they also stored in C:\xampp\xampp\htdocs\HRConsortium? Check the value in Local Info. There's a bug with Dreamweaver in the latest versions of Windows that results in the Site Definition dialog box choosing the parent folder, rather than the actual site folder.

However, if your local files are stored outside the Apache server document root, the problem could be that dependent files are not being transferred to the testing server. Use Windows Explorer to check whether the Connections/connTest.php file exists C:\xampp\xampp\htdocs\HRConsortium\Connections\connTest.php.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 07, 2010 Feb 07, 2010
LATEST

Thank you.

In light of the difficulties I was experiencing, I made the decision to completely remove xampp from my system, including all sql and htdocs contents (fortunately, there was nothing significant to lose).

I then downloaded and installed xampplite.  Upon installing the lite version of xampp, setup my security features, tested the server, as well as update my testing server definitions in DW, there appeared to be no further errors.  I was pleasantly surprised to see everthing working just as it should; I was able to insert records and view my .php files and verify that data was being sent to the database.

Apparently, there must be a difference between the full version of xampp and xampplite. Nonetheless, I am pleased to say that I'm able to move forward with my dynamic page developments.

I wanted to express to you (Mr. Powers) and all those that took valuable time to assist me, my sincerest thanks and appreciation.  Without your help, I am sure I wouldn't have gotten this far.

Have great day!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines