Running PHP 5.1.2; MySQL installed, but not 'seen'
Moderator: General Moderators
Running PHP 5.1.2; MySQL installed, but not 'seen'
Dear folks --
I am running PHP 5.1.2 on my local dev machine, running Windows XP and Apache/2.0.55 (Win32). The PHP part runs fine, and has for months. At the same time that I installed the PHP, I installed MySQL, back in April, but haven't used it at all, and want to use it now.
I can't figure out how to make PHP 'believe' that I have MySQL running. I did the PHP installation with a script from Zend, I am not a command line unix person, I'm a UI developer, and I can't figure this out AT ALL. I uncommented some lines in the PHP.ini file, such as:
extension=msql.dll
and
extension=php_mysql.dll
When I view the php test page, there is no section on MySQL, so I know that PHP is not 'seeing' it. Please help I am totally stuck.
I am running PHP 5.1.2 on my local dev machine, running Windows XP and Apache/2.0.55 (Win32). The PHP part runs fine, and has for months. At the same time that I installed the PHP, I installed MySQL, back in April, but haven't used it at all, and want to use it now.
I can't figure out how to make PHP 'believe' that I have MySQL running. I did the PHP installation with a script from Zend, I am not a command line unix person, I'm a UI developer, and I can't figure this out AT ALL. I uncommented some lines in the PHP.ini file, such as:
extension=msql.dll
and
extension=php_mysql.dll
When I view the php test page, there is no section on MySQL, so I know that PHP is not 'seeing' it. Please help I am totally stuck.
Yes, every time.
When I view the test page that calls phpinfo(), it shows NO additional modules. Nada. None.
This is my extension_dir statement in the php.ini file:
extension_dir = "c:\php\ext"
should it not have quotes? I have tried it without, but am desperate.
Edited to add, that is the directory where all the extension .dll files are stored.
When I view the test page that calls phpinfo(), it shows NO additional modules. Nada. None.
This is my extension_dir statement in the php.ini file:
extension_dir = "c:\php\ext"
should it not have quotes? I have tried it without, but am desperate.
Edited to add, that is the directory where all the extension .dll files are stored.
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
Okay, so you've verified that the php_mysql.dll (and it's required libraries) are there?
Are you sure you're editing the correct php.ini? phpinfo() will list (near the beginning) where it found php.ini. If it lists your Windows directory and the file isn't there, it means it didn't find the file and is instead using defaults across the board.
Did you set the PHPIniDir directive in your httpd.conf?
Are you sure you're editing the correct php.ini? phpinfo() will list (near the beginning) where it found php.ini. If it lists your Windows directory and the file isn't there, it means it didn't find the file and is instead using defaults across the board.
Did you set the PHPIniDir directive in your httpd.conf?
Check on the .dll files being located in c:\php\ext
Check on editing the version of php.ini that phpinfo is looking at.
After googling, I added these lines to my httpd.conf:
PHPIniDir "C:/php"
LoadFile "C:/php/php5ts.dll"
It already had:
LoadModule php5_module "C:/php/php5apache2.dll"
AddType application/x-httpd-php .php
which at least as far as running PHP went, worked fine, I've been making and running PHP pages locally since April with no problems.
Check on editing the version of php.ini that phpinfo is looking at.
After googling, I added these lines to my httpd.conf:
PHPIniDir "C:/php"
LoadFile "C:/php/php5ts.dll"
It already had:
LoadModule php5_module "C:/php/php5apache2.dll"
AddType application/x-httpd-php .php
which at least as far as running PHP went, worked fine, I've been making and running PHP pages locally since April with no problems.
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
If you open up command line, change directories to the php folder and typedoes it show errors or do you find a screen looking like the following? (Don't worry if yours isnt' the same, but it should include mysql in there.
Code: Select all
php -r "var_export(get_loaded_extensions());"Code: Select all
array (
0 => 'bcmath',
1 => 'calendar',
2 => 'com_dotnet',
3 => 'ctype',
4 => 'date',
5 => 'ftp',
6 => 'hash',
7 => 'iconv',
8 => 'odbc',
9 => 'pcre',
10 => 'Reflection',
11 => 'session',
12 => 'libxml',
13 => 'standard',
14 => 'tokenizer',
15 => 'zlib',
16 => 'SimpleXML',
17 => 'dom',
18 => 'SPL',
19 => 'wddx',
20 => 'xml',
21 => 'xmlreader',
22 => 'xmlwriter',
23 => 'mbstring',
24 => 'bcompiler',
25 => 'bitset',
26 => 'blenc',
27 => 'bz2',
28 => 'bz2_filter',
29 => 'cpdf',
30 => 'curl',
31 => 'cvsclient',
32 => 'docblock',
33 => 'event',
34 => 'exif',
35 => 'gd',
36 => 'gmp',
37 => 'id3',
38 => 'imap',
39 => 'json',
40 => 'lzf',
41 => 'mailparse',
42 => 'mcrypt',
43 => 'mcrypt_filter',
44 => 'memcache',
45 => 'mhash',
46 => 'mime_magic',
47 => 'ming',
48 => 'mysql',
49 => 'mysqli',
50 => 'oggvorbis',
51 => 'openssl',
52 => 'pdf',
53 => 'PDO',
54 => 'pdo_mysql',
55 => 'pdo_sqlite',
56 => 'phpdoc',
57 => 'pop3',
58 => 'runkit',
59 => 'shmop',
60 => 'smtp',
61 => 'soap',
62 => 'sockets',
63 => 'SQLite',
64 => 'ssh2',
65 => 'svn',
66 => 'timezonedb',
67 => 'win32ps',
68 => 'win32scheduler',
69 => 'win32std',
70 => 'xmlrpc',
71 => 'xsl',
72 => 'zip',
73 => 'zlib_filter',
74 => 'xdebug',
)Re: Running PHP 5.1.2; MySQL installed, but not 'seen'
Please uselorikay4 wrote:I uncommented some lines in the PHP.ini file
Code: Select all
<?php phpinfo(); ?>- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
That would suggest that your Apache loaded one isn't finding the php.ini that your command line is finding; the one you are apparently editing.
It may just be more simple to ditch trying to set these up yourself and use an installer package such as Xampp.
It may just be more simple to ditch trying to set these up yourself and use an installer package such as Xampp.
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
Do you have a MySQL administration tool of any sort on your computer? If not, you can download MySQL administrator and query browser from the mysql site.
My suggestion would be to make sure that the database server is running and that you can actually connect to it from the client tool. Then I would check your version and make sure you are using at least version 4.1 of MySQL as PHP 5 will have loaded the new MySQL client API.
Also, can you run the following in a new file and tell us the results please.
My suggestion would be to make sure that the database server is running and that you can actually connect to it from the client tool. Then I would check your version and make sure you are using at least version 4.1 of MySQL as PHP 5 will have loaded the new MySQL client API.
Also, can you run the following in a new file and tell us the results please.
Code: Select all
<?php
$neg = array('off', 0, false, '', null);
$flags = array(
'Register Globals' => 'register_globals',
'Short Tags' => 'short_open_tag',
'Display Errors' => 'display_errors',
'Magic Quotes GPC' => 'magic_quotes_gpc',
'Magic Quotes Runtime' => 'magic_quotes_runtime',
'Magic Quotes Sybase' => 'magic_quotes_sybase',
);
$ve = phpversion();
$os = PHP_OS;
$er = intval(error_reporting());
foreach ($flags as $n => $v)
{
$flags[$n] = (in_array(strtolower(ini_get($v)), $neg) ? 'Off' : 'On');
}
$cli = (php_sapi_name() == 'cli');
$eol = "\n";
$gle = get_loaded_extensions();
$rows = array();
$le = '';
$wide = 4;
$j = count($gle);
$pad = $wide - $j % $wide;
$len = max(array_map('strlen', $gle));
$func = create_function('$a', 'return str_pad($a, ' . intval($len) . ');');
$gle = array_map($func, $gle);
for($i = 0; $i < $j; $i += $wide)
{
$le .= ' ' . implode(' ', array_slice($gle, $i, $wide)) . $eol;
}
$ec = array(
'E_STRICT' => 2048, 'E_ALL' => 2047, 'E_USER_NOTICE' => 1024,
'E_USER_WARNING' => 512, 'E_USER_ERROR' => 256, 'E_COMPILE_WARNING' => 128,
'E_COMPILE_ERROR' => 64, 'E_CORE_WARNING' => 32, 'E_CORE_ERROR' => 16,
'E_NOTICE' => 8, 'E_PARSE' => 4, 'E_WARNING' => 2, 'E_ERROR' => 1,
);
$e = array();
$t = $er;
foreach ($ec as $n => $v)
{
if (($t & $v) == $v)
{
$e[] = $n;
$t ^= $v;
}
}
if (ceil(count($ec) / 2) + 1 < count($e))
{
$e2 = array();
foreach ($ec as $n => $v)
{
if (!in_array($n, $e) and $n != 'E_ALL')
{
$e2[] = $n;
}
}
$er = $er . ' ((E_ALL | E_STRICT) ^ ' . implode(' ^ ', $e2) . '))';
}
else
{
$er = $er . ' (' . implode(' | ', $e) . ')';
}
if (!$cli)
{
echo '<html><head><title>quick info</title></head><body><pre>', $eol;
}
echo 'PHP Version: ', $ve, $eol;
echo 'PHP OS: ', $os, $eol;
echo 'Error Reporting: ', $er, $eol;
foreach ($flags as $n => $v)
{
echo $n, ': ', $v, $eol;
}
echo 'Loaded Extensions:', $eol, $le, $eol;
if (!$cli)
{
echo '</pre></body></html>', $eol;
}
?>I was trying to install phpMyAdmin, and the test for whether IT had installed told me it couldn't see mySQL, which has lead me down this path of trying to understand whether PHP could tell I had MySQL installed or not.
The return from your file is as follows:
PHP Version: 5.1.2
PHP OS: WINNT
Error Reporting: 2039 ((E_ALL | E_STRICT) ^ E_STRICT ^ E_NOTICE))
Register Globals: Off
Short Tags: On
Display Errors: On
Magic Quotes GPC: On
Magic Quotes Runtime: Off
Magic Quotes Sybase: Off
Loaded Extensions:
bcmath calendar com_dotnet ctype
date ftp iconv odbc
pcre Reflection session libxml
standard tokenizer zlib SimpleXML
dom SPL wddx xml
xmlreader xmlwriter apache2handler
As you can see, there is no MySQL in that list of loaded extensions.
And as for this question:
[/quote]
The return from your file is as follows:
PHP Version: 5.1.2
PHP OS: WINNT
Error Reporting: 2039 ((E_ALL | E_STRICT) ^ E_STRICT ^ E_NOTICE))
Register Globals: Off
Short Tags: On
Display Errors: On
Magic Quotes GPC: On
Magic Quotes Runtime: Off
Magic Quotes Sybase: Off
Loaded Extensions:
bcmath calendar com_dotnet ctype
date ftp iconv odbc
pcre Reflection session libxml
standard tokenizer zlib SimpleXML
dom SPL wddx xml
xmlreader xmlwriter apache2handler
As you can see, there is no MySQL in that list of loaded extensions.
And as for this question:
I don't know how to make sure the database server is running, and I don't know how to connect to it from the client tool. Are there any EASY client tools out there that don't assume a ton of command line and config knowledge, with clear instructions for installation?My suggestion would be to make sure that the database server is running and that you can actually connect to it from the client tool.
[/quote]
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
Yes, there are. Download the MySQL GUI Tools from the MySQL website, install them and try to connect. Report back when you have done that.
Also, have you made sure to read this information from the PHP manual on installing the MySQL extension on Windows? You might also want to look into the mysqli extension as well.
Also, have you made sure to read this information from the PHP manual on installing the MySQL extension on Windows? You might also want to look into the mysqli extension as well.