php-windows Digest 20 Sep 2003 08:18:33 -0000 Issue 1918
Topics (messages 21448 through 21461):
PHP Apache (GLOBALS) question
21448 by: Frank Tudor
Re: [PHP] PHP Apache (GLOBALS) question
21449 by: Jay Blanchard
21450 by: Frank Tudor
21451 by: Frank Tudor
21452 by: Frank Tudor
21453 by: Jay Blanchard
21455 by: Frank Tudor
21456 by: Frank Tudor
Newbie with a unique problem: PWS and Win98SE
21454 by: Shadowyng
Connection to MS SQL Server
21457 by: Gerardo Rojas
21458 by: Gerardo Rojas
Re: generate img with fonts...
21459 by: Comex
21460 by: Sek-Mun Wong
Re: Warning messages
21461 by: dimitrios seitz
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[EMAIL PROTECTED]
----------------------------------------------------------------------
--- Begin Message ---
I have installed Mandrake Linux and it comes standard with
Apache PHP and MySQL. You can install all these rpms through
the server selection....Anyway.
In my test environment it is function city and of course
register globals were on.
Now I have Taked my PHP.INI-DIST set the globals to on and
copied it to my /etc directory.
It worked like a charm....but guess what. I can't create a
connection string to my database. Now I have to find a solution
to get this website to work with globals on and mysql.
I have tried adding an .htacess with the php globals override
thing
php_value "register_globals" "1"
Ok this didn't work.
So I found the Mysql-PHP RPM on my mandrake cd (of course
enabling my php.ini file) and it didn't work.
I'm getting closer to a solution but I am stuck. Why won't the
htaccess file work? I would like to use my php.ini file but it
is not configured for mysql, how could I fix this? Is there
anything I can do for either of these two questions to get my
globals on?
I swear I will never use functions again if someone helps me.
:)
Frank
__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com
--- End Message ---
--- Begin Message ---
[snip]
I have installed Mandrake Linux and it comes standard with
Apache PHP and MySQL. You can install all these rpms through
the server selection....Anyway.
In my test environment it is function city and of course
register globals were on.
Now I have Taked my PHP.INI-DIST set the globals to on and
copied it to my /etc directory.
It worked like a charm....but guess what. I can't create a
connection string to my database. Now I have to find a solution
to get this website to work with globals on and mysql.
I have tried adding an .htacess with the php globals override
thing
php_value "register_globals" "1"
Ok this didn't work.
So I found the Mysql-PHP RPM on my mandrake cd (of course
enabling my php.ini file) and it didn't work.
I'm getting closer to a solution but I am stuck. Why won't the
htaccess file work? I would like to use my php.ini file but it
is not configured for mysql, how could I fix this? Is there
anything I can do for either of these two questions to get my
globals on?
I swear I will never use functions again if someone helps me.
[/snip]
Actually this sounds like a bunch of mutually exclusive things.
1. Can you run MySQL from the command line?
2. Register_globlas has nothing to do with the connection string to
MySQL
3. Can you show us your connection string code?
--- End Message ---
--- Begin Message ---
I can run mysql from a command line.
What I create a connection string using my php.ini file I get
failure. mysql_connect() errors
My connection string code is very simple:
<?php
//list_db.php
$link_id = mysql_connect("localhost", "username", "password");
$result = mysql_list_dbs($link_id);
$num_rows = mysql_num_rows($result);
while($db_data = mysql_fetch_row($result)) {
echo $db_data[0]. "<BR>";
$result2 = mysql_list_tables($db_data[0]);
$num_rows2 = mysql_num_rows($result2);
while($table_data = mysql_fetch_row($result2)) echo "--" .
$table_data[0]. "<BR>";
echo "==> $num_rows2 table(s) in " . $db_data[0] . "<P>";
}
?>
Using this as a test and all my other connection strings
residing on my include file or one the same page as my code
fails.
--- Jay Blanchard <[EMAIL PROTECTED]> wrote:
> [snip]
> I have installed Mandrake Linux and it comes standard with
> Apache PHP and MySQL. You can install all these rpms through
> the server selection....Anyway.
>
> In my test environment it is function city and of course
> register globals were on.
>
> Now I have Taked my PHP.INI-DIST set the globals to on and
> copied it to my /etc directory.
>
> It worked like a charm....but guess what. I can't create a
> connection string to my database. Now I have to find a
> solution
> to get this website to work with globals on and mysql.
>
> I have tried adding an .htacess with the php globals override
> thing
>
>
> php_value "register_globals" "1"
>
> Ok this didn't work.
>
> So I found the Mysql-PHP RPM on my mandrake cd (of course
> enabling my php.ini file) and it didn't work.
>
> I'm getting closer to a solution but I am stuck. Why won't
> the
> htaccess file work? I would like to use my php.ini file but
> it
> is not configured for mysql, how could I fix this? Is there
> anything I can do for either of these two questions to get my
> globals on?
>
> I swear I will never use functions again if someone helps me.
> [/snip]
>
> Actually this sounds like a bunch of mutually exclusive
> things.
>
> 1. Can you run MySQL from the command line?
> 2. Register_globlas has nothing to do with the connection
> string to
> MySQL
> 3. Can you show us your connection string code?
>
__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com
--- End Message ---
--- Begin Message ---
When I remane my php.ini file I get
/var/lib/mysql/mysql.sock
When I take the .old of the the end of my php.ini.old and put in
my etc directory i don't see any mysql stuff listed.
Frank
--- Marek Kilimajer <[EMAIL PROTECTED]> wrote:
> check your mysql.default_socket setting in php.ini
>
> Frank Tudor wrote:
>
> > I can run mysql from a command line.
> >
> > What I create a connection string using my php.ini file I
> get
> >
> > failure. mysql_connect() errors
> >
> > My connection string code is very simple:
> >
> > <?php
> > //list_db.php
> >
> > $link_id = mysql_connect("localhost", "username",
> "password");
> > $result = mysql_list_dbs($link_id);
> > $num_rows = mysql_num_rows($result);
> >
> > while($db_data = mysql_fetch_row($result)) {
> > echo $db_data[0]. "<BR>";
> > $result2 = mysql_list_tables($db_data[0]);
> > $num_rows2 = mysql_num_rows($result2);
> > while($table_data = mysql_fetch_row($result2)) echo "--" .
> > $table_data[0]. "<BR>";
> > echo "==> $num_rows2 table(s) in " . $db_data[0] . "<P>";
> > }
> > ?>
> > Using this as a test and all my other connection strings
> > residing on my include file or one the same page as my code
> > fails.
> >
> >
> >
> >
> > --- Jay Blanchard <[EMAIL PROTECTED]>
> wrote:
> >
> >>[snip]
> >>I have installed Mandrake Linux and it comes standard with
> >>Apache PHP and MySQL. You can install all these rpms
> through
> >>the server selection....Anyway.
> >>
> >>In my test environment it is function city and of course
> >>register globals were on.
> >>
> >>Now I have Taked my PHP.INI-DIST set the globals to on and
> >>copied it to my /etc directory.
> >>
> >>It worked like a charm....but guess what. I can't create a
> >>connection string to my database. Now I have to find a
> >>solution
> >>to get this website to work with globals on and mysql.
> >>
> >>I have tried adding an .htacess with the php globals
> override
> >>thing
> >>
> >>
> >>php_value "register_globals" "1"
> >>
> >>Ok this didn't work.
> >>
> >>So I found the Mysql-PHP RPM on my mandrake cd (of course
> >>enabling my php.ini file) and it didn't work.
> >>
> >>I'm getting closer to a solution but I am stuck. Why won't
> >>the
> >>htaccess file work? I would like to use my php.ini file but
> >>it
> >>is not configured for mysql, how could I fix this? Is there
> >>anything I can do for either of these two questions to get
> my
> >>globals on?
> >>
> >>I swear I will never use functions again if someone helps
> me.
> >>[/snip]
> >>
> >>Actually this sounds like a bunch of mutually exclusive
> >>things.
> >>
> >>1. Can you run MySQL from the command line?
> >>2. Register_globlas has nothing to do with the connection
> >>string to
> >>MySQL
> >>3. Can you show us your connection string code?
> >>
> >
> >
> >
> > __________________________________
> > Do you Yahoo!?
> > Yahoo! SiteBuilder - Free, easy-to-use web site design
> software
> > http://sitebuilder.yahoo.com
> >
>
__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com
--- End Message ---
--- Begin Message ---
I did set my php.ini file in the etc dir and it worked fine.
But there was no mysql listed when I did a phpinfo.php page.
So more specifically, when I ude my php.ini file i have globals
on but mysql_connect failures
When I don't use php.ini files I get globals set to off and
mysql access
in ref. to .htaccess when I put and .htaccess in a dir and make
and enable httpd.conf to use htaccess it errors in the
http_perl.conf and if I try to edit my vhost config file with
the
php_value "register_globals" "1"
or
php_flag "register_globals" "on"
it failes when i restart my web seerver in the httpd-perl.conf
file
Frank
--- John Nichel <[EMAIL PROTECTED]> wrote:
> Frank Tudor wrote:
> <snip>
> >>It worked like a charm....but guess what. I can't create a
> >>connection string to my database. Now I have to find a
> >>solution
> >>to get this website to work with globals on and mysql.
>
> Register globals has nothing to do with making a connection to
> MySQL.
> Post your code for the connection please.
>
> >>I have tried adding an .htacess with the php globals
> override
> >>thing
> >>
> >>
> >>php_value "register_globals" "1"
> >>
> >>Ok this didn't work.
> >>
> >>So I found the Mysql-PHP RPM on my mandrake cd (of course
> >>enabling my php.ini file) and it didn't work.
> >>
> >>I'm getting closer to a solution but I am stuck. Why won't
> >>the
> >>htaccess file work? I would like to use my php.ini file but
>
> What isn't working for .htaccess? Is Apache configured to
> allow
> .htaccess files the ability to override php variables?
>
> >>it
> >>is not configured for mysql, how could I fix this? Is there
> >>anything I can do for either of these two questions to get
> my
> >>globals on?
>
> Not that you should turn globals on, but if this is really
> what you want
> to do, enable it in your php.ini file, and restart your
> webserver.
>
> >>I swear I will never use functions again if someone helps
> me.
> >>
> >>:)
> >>
> >>Frank
> --
> By-Tor.com
> It's all about the Rush
> http://www.by-tor.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com
--- End Message ---
--- Begin Message ---
[snip]
...please snip replies....
[/snip]
Your php.ini should be in /etc/apache/
Once you have it there restart your Apache server.
Now, let's creat a MySQL connection string in a seperate file (not in
the php.ini, which acording to some of the stuff I have read you have
done. Also there should not a reference to mysql.sock in the php.ini)
that will return errors to us if it fails;
<?php
if(!($dbconnect = mysql_pconnect("name_of_the_database_server",
"user_name", "password"))){
echo"Failed to connect to database!\n";
echo mysql_error."\n";
exit();
}
if(!mysql_select_db("the_database_you_wish_to_use", $dbconnect)){
"Failed to select database!\n";
echo mysql_error()."\n";
exit();
}
?>
Let us know how this works for you.
--- End Message ---
--- Begin Message ---
Thanks for the response.
Ok with php.ini in the ect directory I get a
Call to undefined function: mysql_connect()
Without the php.ini file all my functions fail, because Mandrake
linux has all the latest and greatest apache php and mysql
stuff. so during that build (which doesn't use the php.ini and
frankly I'm not sure where the php stuff is defined in apache),
because before the php.ini files ended up in the etc directory I
had to modify it from the php.ini-dist from the common lib
directory.
does this help?
Frank
--- John Nichel <[EMAIL PROTECTED]> wrote:
> Frank Tudor wrote:
> > Yes to the php-mysql rpm,
> >
> > But listen I think it was the way it built the initial
> appach
> > php mysql configurations I don't think the php.ini refects
> an
> > accurate setup of my php mysql setup.
> >
> > Frank
>
> Let's get away from the php.ini for a moment. Being that you
> did
> everything from RPM, the ini file doesn't come into play here
> (you
> basically have a default setup, with default settings). The
> stock
> php.ini file will do just fine.
>
> What is the output of this code on your box.....
>
> if ([EMAIL PROTECTED]("your_host", "your_username",
> "your_password")){
> echo ( mysql_error() );
> } else {
> echo ( "Connection exists" );
> }
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com
--- End Message ---
--- Begin Message ---
Also,
On the phpinfo.php
MYSQL_SOCKET /var/lib/mysql/mysql.sock
MYSQL_INCLUDE -I/usr/include/mysql
MYSQL_LIBS -L/usr/lib/mysql -lmysqlclient
ARE MISSING.
When I run a phpinfo.php page I get all my config info
with my php.ini file put in the etc dir i get no mention of the
above mysql information
with the php.ini file removed or renamed and then running a
phpinfo page I get
MYSQL information in my config file.
So what can I do because the php.ini file just shows config info
I don't think I can modify it to see mysql can I? doesn't that
have to reply on the rpm install? or when the php libary was
built?
Frank
--- Frank Tudor <[EMAIL PROTECTED]> wrote:
> Thanks for the response.
>
> Ok with php.ini in the ect directory I get a
>
> Call to undefined function: mysql_connect()
>
> Without the php.ini file all my functions fail, because
> Mandrake
> linux has all the latest and greatest apache php and mysql
> stuff. so during that build (which doesn't use the php.ini
> and
> frankly I'm not sure where the php stuff is defined in
> apache),
> because before the php.ini files ended up in the etc directory
> I
> had to modify it from the php.ini-dist from the common lib
> directory.
>
> does this help?
>
> Frank
> --- John Nichel <[EMAIL PROTECTED]> wrote:
> > Frank Tudor wrote:
> > > Yes to the php-mysql rpm,
> > >
> > > But listen I think it was the way it built the initial
> > appach
> > > php mysql configurations I don't think the php.ini
> refects
> > an
> > > accurate setup of my php mysql setup.
> > >
> > > Frank
> >
> > Let's get away from the php.ini for a moment. Being that
> you
> > did
> > everything from RPM, the ini file doesn't come into play
> here
> > (you
> > basically have a default setup, with default settings). The
> > stock
> > php.ini file will do just fine.
> >
> > What is the output of this code on your box.....
> >
> > if ([EMAIL PROTECTED]("your_host", "your_username",
> > "your_password")){
> > echo ( mysql_error() );
> > } else {
> > echo ( "Connection exists" );
> > }
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
>
> __________________________________
> Do you Yahoo!?
> Yahoo! SiteBuilder - Free, easy-to-use web site design
> software
> http://sitebuilder.yahoo.com
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com
--- End Message ---
--- Begin Message ---
Hello!
I am new to the world of PHP and I have attempted to set up PWS on my
computer. I have Windows 98SE. According to my Windows Components list, PWS
is already installed. However...
http://www.php.net/manual/en/install.iis.php
HKEY_LOCAL_MACHINE /System /CurrentControlSet /Services /W3Svc /Parameters
/ScriptMap
Item "ScriptMap" does not exist under the Parameters folder. Instead, I have
a folder named ADCLaunch, and that folder contains two more folders named
AdvancedDataFactory and RDSServer.DataFactory. All of these folders contain
nothing but the defaults.
My php files are not recognized by my computer, so something isn't right
here. Can anyone please help me get this figured out?
Thank you!
Shadowyng
--- End Message ---
--- Begin Message ---
Maybe somebody could shed some light on this subject. I am getting this error, after
I uncommented the line in the php.ini
extensions=php_mssql.dll
Unkown(): Unable to load dynamic library './php_mssql.dll' - the specified module
could not be found
Are there any other modifications that I need for PHP to talk to the ms sql server?
Windows 2000, PHP 4.3.3, MS SQL version 8.00.382
--
Gerardo S. Rojas
--- End Message ---
--- Begin Message ---
I put the file php_mssql.dll in the c:/winnt dir and everything is fine. Thank you.
I read my fix on the PHP site.
This is great that so many different people come together and share ideas and help
each other out.
-----Original Message-----
From: Sascha Kaufmann [mailto:[EMAIL PROTECTED]
Sent: Friday, September 19, 2003 1:31 PM
To: Gerardo Rojas
Subject: Re: [PHP-WIN] Connection to MS SQL Server
you need to set the path to your "extensions" directory
e.g. extension_dir = "c:\php\extensions\"
regards
Sascha
Gerardo Rojas wrote:
> Maybe somebody could shed some light on this subject. I am getting this error,
> after I uncommented the line in the php.ini
>
>
> extensions=php_mssql.dll
>
> Unkown(): Unable to load dynamic library './php_mssql.dll' - the specified module
> could not be found
>
>
> Are there any other modifications that I need for PHP to talk to the ms sql server?
>
> Windows 2000, PHP 4.3.3, MS SQL version 8.00.382
>
>
> --
> Gerardo S. Rojas
>
>
>
>
--- End Message ---
--- Begin Message ---
> ofcourse u can ....
Yes, but it would take less time to not use PHP.
--- End Message ---
--- Begin Message ---
Yes yes, you guys are hilarious but at least try to answer his question! :)
Bobo, I assume you're using Win32 and true type fonts, try this chunk of
code:
You *will* need to install freetype (www.freetype.org) and enable gd/gd2
(depending on your version of php) extensions on your php install.
ref: http://www.php.net/manual/en/function.imagettftext.php
<?php
Header("Content-type: image/jpeg");
$outputtext = "Welcome";
$fontfilename = "BlissIf Caps BoldItalic.ttf"; // whatever the actual
filename is called
$im = ImageCreate(240, 30);
$black = ImageColorAllocate($im, 0, 0, 0);
$white = ImageColorAllocate($im, 255, 255, 255);
if (strpos(strtoupper($HTTP_SERVER_VARS["SERVER_SOFTWARE"]),"WIN",0)
=== false) {
/* UNIX OS, use unix style paths and fontsize */
$fontsize = 60;
$fontpath = "/usr/local/apache/htdocs/fonts/";
} else {
/* Windows OS, use windows style paths and fontsize */
$fontsize = 8;
$fontpath = 'C:\\windows\fonts\\';
}
ImageTTFText($im, $fontsize, 0, 20, 20, $white, $fontpath. $fontfilename,
$outputtext);
ImageJpeg($im);
ImageDestroy($im);
?>
--- End Message ---
--- Begin Message ---
test.php must be:
<html>
<head>
<title>Today's Date</title>
</head>
<body>
<p>Today's Date (according to this Web server) is
<?php
echo date("l, F dS Y.");
?></p>
</body>
</html>
"ascll" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
news:[EMAIL PROTECTED]
> Problem solved. Thanks.
>
>
> "Ascll" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > Greetings,
> >
> > I just installed the PHP Version 4.3.3 on my Windows 2000 Server (SP4)
> > machine. As the starting point, I have tried to run the index.php
> > (configured using IIS 4) without error and I get all those info
regarding
> my
> > php.
> >
> > index.php
> > =========
> > <html>
> > <head>
> > <title>Today's Date</title>
> > </head>
> > <body>
> > <?php phpinfo();?>
> > </body>
> > </html>
> >
> >
> > However, when I try to run another .php file, say test.php, I get these
> > warning messages below: -
> >
> > test.php
> > ========
> > <html>
> > <head>
> > <title>Today's Date</title>
> > </head>
> > <body>
> > <p>Today's Date (according to this Web server) is
> > <?php
> > echo( date('l, F dS Y.') );
> > ?></p>
> > </body>
> > </html>
> >
> >
> > Warning messages
> > ================
> >
> >
> > Warning: Unknown(E:\Nelson\RaceResult\test.php): failed to open stream:
> > Permission denied in Unknown on line 0
> >
> > Warning: (null)(): Failed opening 'E:\Nelson\RaceResult\test.php' for
> > inclusion (include_path='.;c:\php4\pear') in Unknown on line 0
> >
> >
> > Please consult. Thanks in advance.
> >
> >
> > ascll
> > [EMAIL PROTECTED]
--- End Message ---