Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 03-03-2009, 02:30 AM
Red Blaze's Avatar
Red Blaze Red Blaze is offline
 
Join Date: Jan 2003
Location: Texas
Posts: 493
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default PHP and MySQL issue

Ok, this is the first time I successfully installed Apache 2.2, PHP5, and MySQL 5 onto my computer for a developing environment so I don't have to upload constantly. Laptop to be more specific, Windows XP Home Edition.

It renders php very well, except for pages that have mysql involved. For instance, I have have page that has a config.php included at the very top with the following content.

PHP Code:
<?php
session_start
();

$dbhost '**.***.***.**';
$dbuser '**********';
$dbpass '***********';

$conn mysql_connect($dbhost$dbuser$dbpass) or die('Error connecting to mysql');

$dbname 'databasename'//real database name was changed...
mysql_select_db($dbname);

$clientId 2;

define("CLIENTID"2);
define("PATH""/my/home/path/*****/html/");
?>
As I commented out line by line, I came to realize that $conn = mysql_connect is the culprit. I used This Website and followed everything as close as possible. Considering they were using MySQL 4, and not 5.

What I want to know is why won't it tell me an error. It just gives me a flat out blank page. Any ideas to lighten my way? x.x
Reply With Quote
  #2  
Old 03-03-2009, 03:35 AM
TigerC10's Avatar
TigerC10 TigerC10 is offline
 
Join Date: Apr 2006
Location: Austin, TX
Posts: 616
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You probably haven't enabled the PHP extension for MySQL - or if you have, you might have set the extension directory improperly.

Check out this page:
http://www.php-mysql-tutorial.com/wi...and-mysql.aspx

And go to the "Modifying PHP Configuration File ( php.ini )" section.
Reply With Quote
  #3  
Old 03-03-2009, 04:35 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Check the error_log file of your Apache installation. It should tell you the error. Additionally, you should enable error_reporting in PHP's configuration for debugging purposes.
Reply With Quote
  #4  
Old 03-03-2009, 04:45 PM
Red Blaze's Avatar
Red Blaze Red Blaze is offline
 
Join Date: Jan 2003
Location: Texas
Posts: 493
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Alrighty, I followed the link showed to me and I've got it set up right. Now I turned on my laptop today and I got this new little problem.

"httpd.exe: Could not reliably determine the server's fully qualified domain name, using ***.***.*.* for ServerName"

And now, when I got to a page that has a mysql connect involved, Apache2 crashes.

I recently got this error today just as I started my laptop. This wasn't showing last night.

========================

Maybe it'll help if I post where Apache, PHP and MySQL are installed in.

Apache: C:\Server\Apache 2
PHP C:\php
MySQL C:\Server\mysql

in php.ini, which is in Apache 2 directory, I have two edits:
extension_dir = C:\php\ext\
and
extension=php_mysql.dll <- just uncommented

And this is the "Error Signature" I get when Apache crashes:
Quote:
szAppName : httpd.exe szAppVer : 2.2.11.0 szModName : php5ts.dll
szModVer : 5.2.9.9 offset : 0000ac7a
Reply With Quote
  #5  
Old 03-03-2009, 11:15 PM
TigerC10's Avatar
TigerC10 TigerC10 is offline
 
Join Date: Apr 2006
Location: Austin, TX
Posts: 616
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sounds like you don't have your httpd.conf file set up properly.

http://httpd.apache.org/docs/1.3/windows.html#use

Check your ServerName variable and make sure it's set to "localhost" or "127.0.0.1" or even your machine's IP address. That's the URL you'll be using to access your test site (http://localhost/ etc.) in your browser. Do not set this your your actual domain name, as your domain name most likely does not point to this test environment.
Reply With Quote
  #6  
Old 03-04-2009, 03:18 AM
vbplusme vbplusme is offline
 
Join Date: Sep 2008
Location: CyberSpace
Posts: 332
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ServerName localhost:80

its commented out by default...
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:43 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.07783 seconds
  • Memory Usage 2,214KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (6)post_thanks_box
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (6)post_thanks_postbit_info
  • (6)postbit
  • (6)postbit_onlinestatus
  • (6)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete