PHP MSSQL APACHE problem in coonecting to database

Reply

Join Date: Oct 2007
Posts: 1
Reputation: grmurali is an unknown quantity at this point 
Solved Threads: 0
grmurali grmurali is offline Offline
Newbie Poster

PHP MSSQL APACHE problem in coonecting to database

 
0
  #1
Oct 24th, 2007
I am new user I have a system which has Apache2.2.4, PHP 5.2.3 in windows xP proffessional service pack 2. My MSSQL server is in remote place .
I have access to the server by using the windows authentication only.

when I use script
$host='mass.com ';
$user='gs\amk123';
$pass='Almn!2345';( windows password ie my login password)

$connection = mssql_connect($host, $user, $pass) or die("Unable to connect");

i got error like this
[B] Fatal error: Call to undefined function mssql_connect() in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\m.php on line 8

plz give me a solution ASAP.
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 4
Reputation: Rankenian is an unknown quantity at this point 
Solved Threads: 0
Rankenian Rankenian is offline Offline
Newbie Poster

Re: PHP MSSQL APACHE problem in coonecting to database

 
0
  #2
Oct 24th, 2007
I believe the correct function is

  1. mysql_connect();

Not mssql_connect() as you have typed.

Hope that helps.
Reply With Quote Quick reply to this message  
Join Date: Nov 2006
Posts: 187
Reputation: phper is an unknown quantity at this point 
Solved Threads: 15
phper's Avatar
phper phper is offline Offline
Junior Poster

Re: PHP MSSQL APACHE problem in coonecting to database

 
0
  #3
Oct 24th, 2007
Rankenian - mysql_connect(); is the incorrect function. This is to connect to a MYSQL database.

Grmurali - mssql_connect is the correct function to use. The error message you have means that PHP doesn't know what the function is. You may not have uncommented the mssql extension in your php.ini file.

Open php.ini thats in your PHP directory, find your extensions then the mssql extension and remove the ;

Save php.ini, restart Apache and you should be ready to rock.
If my post is useful please add to my reputation.
Thanks.

Ajtrichards Web Solutions | http://www.ajtrichards.co.uk
Retenovate | http://www.retenovate.com
Reply With Quote Quick reply to this message  
Join Date: Nov 2006
Posts: 187
Reputation: phper is an unknown quantity at this point 
Solved Threads: 15
phper's Avatar
phper phper is offline Offline
Junior Poster

Re: PHP MSSQL APACHE problem in coonecting to database

 
0
  #4
Oct 24th, 2007
If my post is useful please add to my reputation.
Thanks.

Ajtrichards Web Solutions | http://www.ajtrichards.co.uk
Retenovate | http://www.retenovate.com
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 271
Reputation: fatihpiristine has a little shameless behaviour in the past 
Solved Threads: 16
fatihpiristine's Avatar
fatihpiristine fatihpiristine is offline Offline
Posting Whiz in Training

Re: PHP MSSQL APACHE problem in coonecting to database

 
0
  #5
Oct 24th, 2007
since when we have "\" slash in user names?

try these

gsamk123
Last edited by fatihpiristine; Oct 24th, 2007 at 7:29 pm.
Do a favour, leave me alone
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 12
Reputation: naturegirrrl is an unknown quantity at this point 
Solved Threads: 0
naturegirrrl's Avatar
naturegirrrl naturegirrrl is offline Offline
Newbie Poster

Re: PHP MSSQL APACHE problem in coonecting to database

 
0
  #6
Nov 4th, 2007
I am reading the posts trying to resolve my Apache/php problem and noted this post about a PHP.ini file.
Did a search and I don't have a PHP.ini file.

I did download PHP
Downloaded Apache and got it to run

but not publishing at http:/localhost to see my hello world program which lives in my htdocs rootl.

Any ideas? I'm really frying here.
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 271
Reputation: fatihpiristine has a little shameless behaviour in the past 
Solved Threads: 16
fatihpiristine's Avatar
fatihpiristine fatihpiristine is offline Offline
Posting Whiz in Training

Re: PHP MSSQL APACHE problem in coonecting to database

 
0
  #7
Nov 4th, 2007
in http.conf

find this row: ( this setting is for my server, change the path )

DocumentRoot "d:/websites"

#
# Each directory to which Apache has access can be configured with respect
# to which services and features are allowed and/or disabled in that
# directory (and its subdirectories).
#
# First, we configure the "default" to be a very restrictive set of
# features.
#
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Satisfy all
</Directory>

#
# This should be changed to whatever you set DocumentRoot to.
#


change this one also as path

<Directory "d:/websites">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.2/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks

#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride None

#
# Controls who can get stuff from this server.
#
Order allow,deny
Allow from all

</Directory>

#
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#


here you set what file is gonna be shown as first
i set it index.aaa
if you want to show index.php as main file set it to index.php


<IfModule dir_module>
DirectoryIndex index.aaa
</IfModule>
Last edited by fatihpiristine; Nov 4th, 2007 at 5:15 pm.
Do a favour, leave me alone
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 12
Reputation: naturegirrrl is an unknown quantity at this point 
Solved Threads: 0
naturegirrrl's Avatar
naturegirrrl naturegirrrl is offline Offline
Newbie Poster

Re: PHP MSSQL APACHE problem in coonecting to database

 
0
  #8
Nov 4th, 2007
apache seems to be working fine with html file but NOT php

have added php to addtypes

When I click on a php page get an error that says doesn't know what to open it with

thanks,
b
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 271
Reputation: fatihpiristine has a little shameless behaviour in the past 
Solved Threads: 16
fatihpiristine's Avatar
fatihpiristine fatihpiristine is offline Offline
Posting Whiz in Training

Re: PHP MSSQL APACHE problem in coonecting to database

 
0
  #9
Nov 4th, 2007
didnt you install php??
Do a favour, leave me alone
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 12
Reputation: naturegirrrl is an unknown quantity at this point 
Solved Threads: 0
naturegirrrl's Avatar
naturegirrrl naturegirrrl is offline Offline
Newbie Poster

Re: PHP MSSQL APACHE problem in coonecting to database

 
0
  #10
Nov 4th, 2007
Hi all, getting weary here, any help appreciated BIG TIME!

everything seems to be working, (thank god) except the parsing of php
apache and browser see and parse .html files but not .php files

If I call a php file in the browser it will parse the html <title> tag but not the php echo to the page.

I am getting dumber by the minute and need to have this working by day break tomorrow AM.

yes I did install PHP, and Rapid PHP 2007 IDE, and Html-kit IDE with PHP plug ins--oh but forgot the kitchen sink.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:




Views: 2899 | Replies: 9
Thread Tools Search this Thread



Tag cloud for PHP
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC