Apache, php and mysql

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
go5NuuhxS
Forum Newbie
Posts: 2
Joined: Wed Feb 06, 2008 10:30 pm

Apache, php and mysql

Post by go5NuuhxS »

Hello

I am having an odd problem, i've installed php,mysql and apache, everything works fine except mysql.
Its not the usual problem though, if i run C:\dev\Apache2.2\php\php.exe C:\dev\Apache2.2\htdocs\index.php, php will execute the code and run the mysql query.

however if i am to load http://localhost/index.php, i get:
Fatal error: Call to undefined function mysql_connect() in C:\dev\Apache2.2\htdocs\index.php on line 5

So mysql does work with php, and php does work with apache, but mysql doesnt work with apache :S

anyone had a similar problem?
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: Apache, php and mysql

Post by Christopher »

Sound like Apache is not telling PHP where it is located. What are the lines in your httpd.conf file?
(#10850)
go5NuuhxS
Forum Newbie
Posts: 2
Joined: Wed Feb 06, 2008 10:30 pm

Re: Apache, php and mysql

Post by go5NuuhxS »

ScriptAlias /php/ "C:/dev/Apache2.2/php/"
AddType application/x-httpd-php .php
Action application/x-httpd-php "/php/php.exe"
AddType application/x-httpd-php-source .phps
LoadModule php5_module "C:/dev/Apache2.2/php/php5apache2_2.dll"
PHPIniDir "C:/dev/Apache2.2/php/x/"
Post Reply