logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Other Software View previous topic :: View next topic
Reply to topic   Topic: Two issues, (i) DocumentRoot and (ii) Remote MySQL queries
Author
poojagirl



Joined: 05 Nov 2012
Posts: 5
Location: Canada, Toronto

PostPosted: Sun 25 Nov '12 23:29    Post subject: Two issues, (i) DocumentRoot and (ii) Remote MySQL queries Reply with quote

My environment is as follows:

- Windows 7, 32 bit
- Apache 2.4.3-win32
- PHP-5.4.8-Win32-VC9-x86
- MySQL 5.2.44


Two issues:
1. I am unable to set the DocumentRoot to a folder on a mapped drive. The web server does not start up at all
2. DB queries do not work when the web site is accessed from a remote server.


Issue 1:
Below is the snippet from the http.conf file. When the document root is in the C drive, the server starts up just fine, but not when set to that in I drive.

DocumentRoot "c:/Apache24/htdocs/website"
# DocumentRoot "i:/website"
# <Directory "i:/website">
<Directory "c:/Apache24/htdocs/website">
............
Directives, Directives
............
</Directory>


In the system events logs, I get the following two errors:
The Apache service named reported the following error: >>>
AH00526: Syntax error on line 238 of C:/Apache24/conf/httpd.conf:


And

The Apache service named reported the following error: >>>
DocumentRoot must be a directory


I confirmed the folder name and that it exists. Where am I going wrong?

Issue 2:
All pages work just fine from the local server. When html and PHP files opened from a remote server, it still works fine. However, when the pages include a query into MySQL DB, it takes a long time and displays:

couldnt connect to my sqlA connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.

I have not been able to debug this further.

Please help. Thanks in advance
Back to top
poojagirl



Joined: 05 Nov 2012
Posts: 5
Location: Canada, Toronto

PostPosted: Mon 26 Nov '12 2:55    Post subject: Reply with quote

Issue 1 is resolved, thanks to an earlier posting under the "Apache" forum from Steffen, I was able to reconfigure the web server to run as a local user and alias the network mapped drive.

Please search for "Point to a network drive?". A useful link is "http://everything2.com/index.pl?node_id=1920844".

I still need help with Issue #2.
Back to top
poojagirl



Joined: 05 Nov 2012
Posts: 5
Location: Canada, Toronto

PostPosted: Tue 27 Nov '12 1:29    Post subject: RESOLVED: Two issues, (i) DocumentRoot and (ii) Remote MySQL Reply with quote

Never mind, I have now resolved the second issue too. This was due to the MySQL definition that PHP was configured to look up. It was defined thusly:

<?php

if ($_SERVER['HTTP_HOST']!= 'localhost')
{
$host="localhost";
$user="<user>";
$pass="<password>";
$db="<db_name>";
}
else
{
$host="localhost";
$user="<user>";
$pass="<password>";
$db="<db_name>";
}
$link=mysql_connect($host,$user,$pass)or die("couldnt connect to my sql".mysql_error());
mysql_select_db($db,$link)or die("couldnt select database".mysql_error());


$protocol = "http://";
$server = $_SERVER['SERVER_NAME'];
$admin = "<path>";
$admRu = $protocol.$server.$admin;
//echo $admRu;

?>


The host definition in bold had to be tweaked so that the call would be made to the DB.

Hopefully, this is helpful to someone down the road.
Back to top


Reply to topic   Topic: Two issues, (i) DocumentRoot and (ii) Remote MySQL queries View previous topic :: View next topic
Post new topic   Forum Index -> Other Software