php-windows Digest 15 Apr 2001 11:42:31 -0000 Issue 545

Topics (messages 6731 through 6742):

Re: Problem with PHP and tiny web server
        6731 by: Animorph840
        6735 by: Phil Driscoll

Need PHP/MySQL Assistance
        6732 by: Bob Sears
        6733 by: Tomasz Abramowicz
        6738 by: Plutarck

WinNT, PHP4, IIS4, exec() Nothing Happens at all!
        6734 by: Dave Faulkner

MySQL problem
        6736 by: Chris
        6740 by: Plutarck
        6742 by: Chris

Re: MySql pconnect
        6737 by: Plutarck
        6739 by: James Moore
        6741 by: Phil Driscoll

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]


----------------------------------------------------------------------


I already have PHP running on it as a filter, but Xitami, although small, is
about 10 times bigger than tiny webserver, and has a tray icon.  I want to
keep ram usage to a bare minimum.


""Phil Driscoll"" <[EMAIL PROTECTED]> wrote in message
002401c0c472$0ec3e950$0c01a8c0@philsntserver">news:002401c0c472$0ec3e950$0c01a8c0@philsntserver...
> > How could I fix this?
> Get a proper web server ;)
> Apache is probably overkill  for a Win98 setup - try Xitami
> (www.imatix.com) - easy to set up, and works a treat.
>
> Cheers
> --
> Phil Driscoll
> Dial Solutions
> +44 (0)113 294 5112
> http://www.dialsolutions.com
> http://www.dtonline.org
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>






>I already have PHP running on it as a filter, but Xitami, although small,
is
>about 10 times bigger than tiny webserver, and has a tray icon.  I want to
>keep ram usage to a bare minimum.
Sadly though, it appears that the tiny web server has saved some of its
memory by not implementing a cgi interface. How about calling php directly
rather than using a web server at all?

Cheers
--
Phil Driscoll
Dial Solutions
+44 (0)113 294 5112
http://www.dialsolutions.com
http://www.dtonline.org






Having programmed for 30+ years, I an no stranger to code; however, the 
PHP/MySQL relationship is giving me fits and causing
delays in a partial rewrite of my first shopping-cart system for a local 
retailer. I simply want to process tables in the MySQL
data base. Something is not clicking; I'm probably too deep into the forest 
to see the trees. Is there anyone out there who has
PHP/MySQL experience and has a few minutes to spare hat could scan a 120 
line PHP module and point me in the right direction.
That's all I need ... a little nudge because I will use that as the pattern 
for the on-line portion, as what I'm doing presently is
creating the table maintenance routines.



Bob Sears
Application Developer/Programmer
Internet --> Mainframe, Unix/Aix, OS/JCL
HTML, PHP, Perl, Javascript, VBScript, VB, C, COBOL, C++, Fortran, RPG and 
21 more
Informix, MySQL, Total
317-882-8056
[EMAIL PROTECTED]
Resume on-line: <http://www.on-net.net/~rsears/resumes/bob/bob.html>
Site samples    : <http://www.on-net.net/~rsears/webwyshez/webwyshez.html>





lets have a look..



>
> Having programmed for 30+ years, I an no stranger to code; however, the
> PHP/MySQL relationship is giving me fits and causing
> delays in a partial rewrite of my first shopping-cart system for a local
> retailer. I simply want to process tables in the MySQL
> data base. Something is not clicking; I'm probably too deep into the
forest
> to see the trees. Is there anyone out there who has
> PHP/MySQL experience and has a few minutes to spare hat could scan a 120
> line PHP module and point me in the right direction.
> That's all I need ... a little nudge because I will use that as the
pattern
> for the on-line portion, as what I'm doing presently is
> creating the table maintenance routines.
>
>
>
> Bob Sears
> Application Developer/Programmer
> Internet --> Mainframe, Unix/Aix, OS/JCL
> HTML, PHP, Perl, Javascript, VBScript, VB, C, COBOL, C++, Fortran, RPG and
> 21 more
> Informix, MySQL, Total
> 317-882-8056
> [EMAIL PROTECTED]
> Resume on-line: <http://www.on-net.net/~rsears/resumes/bob/bob.html>
> Site samples    : <http://www.on-net.net/~rsears/webwyshez/webwyshez.html>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>





Yah, either paste it in or paste a link to the code.

Only 120 lines of code is a nice learning chunk. 1000 lines of MySQL
oriented functions make it easy by comparison ;) (I especially like when I
get a parse error on line "764", when that's the last line of the script,
and it's because I forgot a concatenation operator on line 500)

So yeah, we'd be happy to give you a nudge or two :)



--
Plutarck
Should be working on something...
...but forgot what it was.


""Tomasz Abramowicz"" <[EMAIL PROTECTED]> wrote in message
000a01c0c558$9a170e10$0500000a@angel">news:000a01c0c558$9a170e10$0500000a@angel...
> lets have a look..
>
>
>
> >
> > Having programmed for 30+ years, I an no stranger to code; however, the
> > PHP/MySQL relationship is giving me fits and causing
> > delays in a partial rewrite of my first shopping-cart system for a local
> > retailer. I simply want to process tables in the MySQL
> > data base. Something is not clicking; I'm probably too deep into the
> forest
> > to see the trees. Is there anyone out there who has
> > PHP/MySQL experience and has a few minutes to spare hat could scan a 120
> > line PHP module and point me in the right direction.
> > That's all I need ... a little nudge because I will use that as the
> pattern
> > for the on-line portion, as what I'm doing presently is
> > creating the table maintenance routines.
> >
> >
> >
> > Bob Sears
> > Application Developer/Programmer
> > Internet --> Mainframe, Unix/Aix, OS/JCL
> > HTML, PHP, Perl, Javascript, VBScript, VB, C, COBOL, C++, Fortran, RPG
and
> > 21 more
> > Informix, MySQL, Total
> > 317-882-8056
> > [EMAIL PROTECTED]
> > Resume on-line: <http://www.on-net.net/~rsears/resumes/bob/bob.html>
> > Site samples    :
<http://www.on-net.net/~rsears/webwyshez/webwyshez.html>
> >
> >
> > --
> > PHP Windows Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>






Hi People!,

this seems like an age old question that just doesnt seem to be able to get
solved. I too have a problem calling NT programs from within my PHP script.
Hoepfull there is a guru out there who will be able to tell me what i am
doing wrong.

As the subject states, i am running WinNT4, SP6, IIS4, PHP4. I have a web
page that users can use to upload pictures to my server. This script it
pasted below

<?

include "header.inc";
if ($image_name != "") {
copy("$image", "../aviation/uploads/$image_name") or die ("Couldn't copy the
file.");

} else {

 die("You forgot to add a filename");

}

$img_location = "aviation/uploads/$image_name";

$db = mysql_connect("user", "password") or die("Can't connect to server.");
mysql_select_db("database", $db) or die("Can't select database.");



$insert_data = "INSERT INTO table (image, fname, lname, email, location,
rego, remarks, airline) VALUES ('URL/$image_name', '$fname', '$lname',
'$email', '$location', '$rego', '$remarks', '$airline')";

mysql_query($insert_data) or die("Couldn't insert data.");

system("echo File has been uploaded! | blat - -s \"$image_name
uploaded --\" -t $email");

?>

This php file is called from another HTML file. All this info is passed into
the database, and at the same time the image itself is copied to another
directory on the server. All that works excellently!!!. However, what i want
to do is, i want to add some form of compression to the picture (before or
after doesnt matter) when it is copied to the directory. The idea behind
this is so that when people come to my web site and query the database on
pictures, they are compressed a little to save download time.

PROBLEM: I have tried all sorts of things from cjpeg/djpeg to trying to call
an expternal program called "autobatchit.exe" with the php file to add
compression etc.

Below is some of the stuff i have tried:

// exec("I:\Perl\bin\cjpeg.exe -quality 30 -progressive $image_name");
// exec("c:/autobatchit!/autobatchit.exe");
// exec("c:\autobatchit!\autobatchit.exe");
// exec("c:\command.com /k autobatchit.bat" );

And other variations which i have not added. The results are varying. If i
use "cmd" int he exec() anywhere, the script seems to halt at that point and
wont go any further. However all of the above lines result in NOTHING
happening at all!........if i look at the task manager while i run the
script, nithing comes up at all in relation to what i am trying to execute.

SO thats about it!!.............the persont hat solves the problem for me
gets a free freddo!!!

In all honesty i have tried a lot of different stuff that just doesnt seem
to work. If anyone can help me out with this i owuld be very appreciative. I
have been trying for days to ge tthis working with no luck. It is quite
possible that i have missed something very simple as i have only been
working with php (or any coding for that matter) for about two weeks now.

Thanks in advnace for any help anyone can give me

Regards

Dave Faulkner







I was trying to create a database for PHP using MySQL with the command
c:\mysql\bin>mysqladmin create database01 and I received the following
error message
"Can't connect to MySQL server on 'localhost' (10061)
Check that mysql is running on localhost and that the port is 3306.
You can check this by doing 'telnet localhost 3306'"

The Apache server is running. What should I do now?




Try going into your mysql bin directory, then type:

mysql.exe

Then try using connect, or just doing your query.

If that doesn't work, ensure MySQL is running. If that doesn't work...then
there is some other problem.


--
Plutarck
Should be working on something...
...but forgot what it was.


"Chris" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I was trying to create a database for PHP using MySQL with the command
> c:\mysql\bin>mysqladmin create database01 and I received the following
> error message
> "Can't connect to MySQL server on 'localhost' (10061)
> Check that mysql is running on localhost and that the port is 3306.
> You can check this by doing 'telnet localhost 3306'"
>
> The Apache server is running. What should I do now?
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>






Thanks for the reply.

I went to mysql bin directory and typed mysql.exe, I get an error
message
"Error 2003: Can't connect to MySQL server on 'localhost' (10061)"

What's the problem? Please advise.

I am running Win98SE with Apache.



Plutarck wrote:
> 
> Try going into your mysql bin directory, then type:
> 
> mysql.exe
> 
> Then try using connect, or just doing your query.
> 
> If that doesn't work, ensure MySQL is running. If that doesn't work...then
> there is some other problem.
> 
> --
> Plutarck
> Should be working on something...
> ...but forgot what it was.
> 
> "Chris" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > I was trying to create a database for PHP using MySQL with the command
> > c:\mysql\bin>mysqladmin create database01 and I received the following
> > error message
> > "Can't connect to MySQL server on 'localhost' (10061)
> > Check that mysql is running on localhost and that the port is 3306.
> > You can check this by doing 'telnet localhost 3306'"
> >
> > The Apache server is running. What should I do now?
> >
> > --
> > PHP Windows Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
> 
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]




For connect vs. pconnect, the instances where you should use pconnect are
really rare.

When in doubt, use connect. If you know of a specifically good reason to use
it, then feel free.

But I personally have never had a situation where pconnect worked better
than connect.

And as for extended server status, I haven't a clue about it :)


--
Plutarck
Should be working on something...
...but forgot what it was.


""PHPWIN"" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Hi
   Can anyone tell me if it is better to use pconnect or connect for mysql,
when I run my site eventually on a linux server, with apache, php4?
   And does anyone know anything about extended server status in MySql?
Things run alot better with this off when developing on win98.

Thanks
Xon










>
> For connect vs. pconnect, the instances where you should use pconnect are
> really rare.
>
> When in doubt, use connect. If you know of a specifically good
> reason to use
> it, then feel free.
>
> But I personally have never had a situation where pconnect worked better
> than connect.

pconnect is better to use IMHO on any site with a decent amount of hits as
youll get better performance due to the lack of the overhead of making a new
connection every time a page is called. I would totally disagree with you
here plutarck pconnect is there to make things quicker which it does by
keeping the connection open between page requests.

> And as for extended server status, I haven't a clue about it :)

Never looked into it really.. probably not worth it.. try asking on the
php-db list.

-James
--
James Moore
[EMAIL PROTECTED]
http://www.perl.com/search/index.php - we must be doing somthing right






I agree with James on this one - surely it makes sense if php is running as
a server module and can keep hold of connections to utilise the performance
advantage of pconnect.

I'd be interested to know if there are any disadvantages to this, I may need
to change some code :)

Cheers
--
Phil Driscoll
Dial Solutions
+44 (0)113 294 5112
http://www.dialsolutions.com
http://www.dtonline.org



Reply via email to