vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   PHP and MySQL issue (https://vborg.vbsupport.ru/showthread.php?t=207168)

Red Blaze 03-03-2009 02:30 AM

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

TigerC10 03-03-2009 03:35 AM

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.

Dismounted 03-03-2009 04:35 AM

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.

Red Blaze 03-03-2009 04:45 PM

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

TigerC10 03-03-2009 11:15 PM

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.

vbplusme 03-04-2009 03:18 AM

ServerName localhost:80

its commented out by default...


All times are GMT. The time now is 12:38 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01298 seconds
  • Memory Usage 1,730KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete