[PHP] PHP 5.2.2 - Undefined Function mysql_connect()

2007-05-07 Thread Jason Paschal

I use this setup locally for testing/playing.  I recently installed the
latest and greatest of the AMP collection.

Apache 2.2.4
PHP 5.2.2
MySQL 5.0.37

Apache and PHP work fine together, but I wanted to hook it up to a local
test database, so  I installed MySQL.

In php.ini, i have:

; Directory in which the loadable extensions (modules) reside.
extension_dir = "C:\PHP"

i made sure that i moved the dll to that folder, just like i did with the gd
dll.

And then i uncommented this line:

extension=php_mysql.dll

I restarted Apache, and ran a simple test script:



and I get the error:

*Fatal error*: Call to undefined function mysql_connect()

any ideas?

thanks in advance,
jason


Re: [PHP] PHP 5.2.2 - Undefined Function mysql_connect()

2007-05-07 Thread Davi
Em Segunda 07 Maio 2007 08:12, Jason Paschal escreveu:
> I use this setup locally for testing/playing.  I recently installed the
> latest and greatest of the AMP collection.
>
> Apache 2.2.4
> PHP 5.2.2
> MySQL 5.0.37
>
> Apache and PHP work fine together, but I wanted to hook it up to a local
> test database, so  I installed MySQL.
>
> In php.ini, i have:
>
> ; Directory in which the loadable extensions (modules) reside.
> extension_dir = "C:\PHP"
>
> i made sure that i moved the dll to that folder, just like i did with the
> gd dll.
>
> And then i uncommented this line:
>
> extension=php_mysql.dll
>
> I restarted Apache, and ran a simple test script:
>
>  ini_set("display_errors","1");
> $cn = mysql_connect("localhost","root","password");
> ?>
>
> and I get the error:
>
> *Fatal error*: Call to undefined function mysql_connect()
>
> any ideas?
>

First: have you tried mysql-cli?
Second: have you take a look at phpinfo()?

HTH

-- 
Davi Vidal
[EMAIL PROTECTED]
[EMAIL PROTECTED]
--
"Religion, ideology, resources, land,
spite, love or "just because"...
No matter how pathetic the reason,
it's enough to start a war. "


pgpqTKyP488jG.pgp
Description: PGP signature


[PHP] Re: PHP 5.2.2 - Undefined Function mysql_connect()

2007-05-07 Thread zerof

Jason Paschal escreveu:

I use this setup locally for testing/playing.  I recently installed the
latest and greatest of the AMP collection.

Apache 2.2.4
PHP 5.2.2
MySQL 5.0.37

Apache and PHP work fine together, but I wanted to hook it up to a local
test database, so  I installed MySQL.

In php.ini, i have:

; Directory in which the loadable extensions (modules) reside.
extension_dir = "C:\PHP"


--
If you have installed all AMP individualy, the

> extension_dir = "C:\PHP"

must be

extension_dir = "C:\PHP\ext"


... where other PECL extensions must be unziped, too.
--



i made sure that i moved the dll to that folder, just like i did with 
the gd

dll.

And then i uncommented this line:

extension=php_mysql.dll

I restarted Apache, and ran a simple test script:



and I get the error:

*Fatal error*: Call to undefined function mysql_connect()

any ideas?

thanks in advance,
jason


--
--
zerof
http://www.educar.pro.br/
Apache - PHP - MySQL - Boolean Logics - Project Management
--
Você deve, sempre, consultar uma segunda opinião!
--
Deixe todos saberem se esta informação foi-lhe útil.
--  
You must hear, always, one second opinion! In all cases.
--
Let the people know if this info was useful for you!
--

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP 5.2.2 - Undefined Function mysql_connect()

2007-05-07 Thread Davi
Em Segunda 07 Maio 2007 09:03, Jason Paschal escreveu:
> thank you for responding.
>
> phpinfo shows that it is finding the correct file:
>
> Loaded Configuration File: C:\PHP\php.ini
>
> that is the correct file with the correct settings.
>
> i renamed it and phpinfo showed (none).  i set it back to the correct name,
> php.ini, and now phpinfo shows C:\PHP\php.ini
>
> so i know it's finding the right file.
>
> still the same problem, though.
>

Yeah... But you must look at mysql section in phpinfo()...

If it's there, all must work fine... Otherwise, you must check your php.ini...



-- 
Davi Vidal
[EMAIL PROTECTED]
[EMAIL PROTECTED]
--
"Religion, ideology, resources, land,
spite, love or "just because"...
No matter how pathetic the reason,
it's enough to start a war. "


pgpD6oFhyNR4X.pgp
Description: PGP signature


Re: [PHP] PHP 5.2.2 - Undefined Function mysql_connect()

2007-05-07 Thread Davi
Em Segunda 07 Maio 2007 09:37, você escreveu:
> I FOUND THE SOLUTION:
>
> i copied libmysql.dll and php_mysql.dll to my c:\windows\ folder
>
> suddenly my script connects.  that's all it took.
>
> thank you for taking the time to help.  maybe this info can help you or
> someone you know.
>

Sure! =]

But... Consider reply to list next time... =]


-- 
Davi Vidal
[EMAIL PROTECTED]
[EMAIL PROTECTED]
--
"Religion, ideology, resources, land,
spite, love or "just because"...
No matter how pathetic the reason,
it's enough to start a war. "


pgplrhIY4ZYw1.pgp
Description: PGP signature


[PHP] Blocking the direct download of a file

2007-05-07 Thread pw


Hello,

I have a phtml file that contains a reference to
a java archive (jar) file.

I only want the archive used in the context of
a specific html page. I don't want the archive
to be downloaded directly.

I thought, at first, I could just use a php page as my jar reference:












I would then use the following in jar.php:

http://www.myweb.com/index.phtml";)==0)
{

header("Location: ./primary.jar");
}
else
{
header("Location: ./secondary.jar");
}
?>


The problem is I get a java.lang.ClassNotFoundException.

Is there a way to change a reference like this
'on-the-fly' so to speak?

Is my code wrong and this method can be modified
to work?


Thanks for any info,

Peter

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Blocking the direct download of a file

2007-05-07 Thread Davi
Em Segunda 07 Maio 2007 12:36, pw escreveu:
>   $referrer=$_SERVER['HTTP_REFERRER'];
>  if(strcmp($referrer,"http://www.myweb.com/index.phtml";)==0)
> {
>
>  header("Location: ./primary.jar");
> }
> else
> {
>  header("Location: ./secondary.jar");
> }
> ?>
>
>
> The problem is I get a java.lang.ClassNotFoundException.
>
> Is there a way to change a reference like this
> 'on-the-fly' so to speak?
>
> Is my code wrong and this method can be modified
> to work?
>

Change the content-type?

I don't known how to do it... But I would try it... =]

HTH
-- 
Davi Vidal
[EMAIL PROTECTED]
[EMAIL PROTECTED]
--
"Religion, ideology, resources, land,
spite, love or "just because"...
No matter how pathetic the reason,
it's enough to start a war. "


pgplWVNgnpSCv.pgp
Description: PGP signature


Re: [PHP] Blocking the direct download of a file

2007-05-07 Thread Jon Anderson

pw wrote:

I have a phtml file that contains a reference to
a java archive (jar) file.

I only want the archive used in the context of
a specific html page. I don't want the archive
to be downloaded directly. 


I can think of two easy ways to do this. If you're using Apache, you 
could fiddle with the config a little to deny non-local downloads:


SetEnvIfNoCase Referer "^http://www.myweb.com/"; local_ref=1

   Order Allow, Deny
   Allow From env=local_ref


(Stolen from: http://apache-server.com/tutorials/ATimage-theft.html. 
Have used something similar, but don't want to dig through my own configs.)


Alternately, you can do something like this - similar to your idea, but 
in this case, the download actually happens from the PHP script:


if (strpos($_SERVER['HTTP_REFERER'],'http://www.myweb.com/') === 0) {
   header('Content-Type: application/java-archive');
   readfile('/path/to/real/jarfile.jar');
   exit(0);
}


There are probably lots of other ways to do that kind of thing.

jon

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Blocking the direct download of a file

2007-05-07 Thread Greg Donald

On 5/7/07, Jon Anderson <[EMAIL PROTECTED]> wrote:

if (strpos($_SERVER['HTTP_REFERER'],'http://www.myweb.com/') === 0) {
header('Content-Type: application/java-archive');
readfile('/path/to/real/jarfile.jar');
exit(0);
}



$_SERVER['HTTP_REFERER'] is unreliable.

http://us2.php.net/manual/en/reserved.variables.php#reserved.variables.server



--
Greg Donald
http://destiney.com/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Blocking the direct download of a file

2007-05-07 Thread Jon Anderson

Greg Donald wrote:

$_SERVER['HTTP_REFERER'] is unreliable.

http://us2.php.net/manual/en/reserved.variables.php#reserved.variables.server 



So?

In the context, I think the only thing that matters is that other people 
don't link to his jar file from other websites.


jon

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Blocking the direct download of a file

2007-05-07 Thread Greg Donald

On 5/7/07, Jon Anderson <[EMAIL PROTECTED]> wrote:

In the context, I think the only thing that matters is that other people
don't link to his jar file from other websites.



There will be legitimate requests that will fail since not all
browsers send a referer.


--
Greg Donald
http://destiney.com/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Blocking the direct download of a file

2007-05-07 Thread Jon Anderson

Greg Donald wrote:

There will be legitimate requests that will fail since not all
browsers send a referer.


How many browsers out there that support the Java plug-in will not 
support referrers?


Besides, the simple solution to that problem is just check for a 
non-existant referrer. If the browser doesn't support it, then it works 
anyway.


jon

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Blocking the direct download of a file

2007-05-07 Thread Stut

Jon Anderson wrote:

Greg Donald wrote:

There will be legitimate requests that will fail since not all
browsers send a referer.


How many browsers out there that support the Java plug-in will not 
support referrers?


Besides, the simple solution to that problem is just check for a 
non-existant referrer. If the browser doesn't support it, then it works 
anyway.


It's not a question of support, it's a question of something stripping 
it out before the request hits your server. This could be the browser, 
or a proxy, or pretty much anything else the request goes through.


The "solution", as you rightly point out, is to simply allow it if there 
is no referrer.


-Stut

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Send binary files with gzip encoding disabled

2007-05-07 Thread strawks
On ven, 2007-05-04 at 17:51 +0200, Emmanuel Raulo-Kumagai wrote:
> I have about the same code except that I use "application/x-zip-archive"
> for the content type and it just works.
> There's no ob_* stuff in my code also.

application/x-zip-archive works (actually anything but application/zip
works, even image MIME types and others), but I think I will use
application/octet-stream.
I didn't find the list of standard MIME types, but it seems
application/zip or application/x-zip-compressed should be used here
(those are used by MUAs when sending ZIP files).

Thanks for your help.

-- 
strawks

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] losing session variable

2007-05-07 Thread Oscar Gosdinski

On 5/6/07, Alain Roger <[EMAIL PROTECTED]> wrote:

if i check before header command what is the value of $_SESSION['username'],
i get the right value.
however, if i place on the first line of welcome.php file the following code
:

echo "1. Before session";
> session_start();
> echo"Username : ".$_SESSION['username'];
> echo "2. After session";
>

i get empty value for this session variable.
How is it possible ?


You have to execute the session_start method before any data have been
sent to the client. You are sending data to the browser with 'echo
"1. Befor Session";'

--
Saludos
Oscar

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] CMS Systems

2007-05-07 Thread Joey
Does anyone know of any good open source CMS system? ( content management
system )

 

Thanks!


Joey

 

 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] CMS Systems

2007-05-07 Thread Davi
Em Segunda 07 Maio 2007 16:46, Joey escreveu:
> Does anyone know of any good open source CMS system? ( content management
> system )
>

XOOPS is a good one...


-- 
Davi Vidal
[EMAIL PROTECTED]
[EMAIL PROTECTED]
--
"Religion, ideology, resources, land,
spite, love or "just because"...
No matter how pathetic the reason,
it's enough to start a war. "


pgpM40hSwSTzH.pgp
Description: PGP signature


Re: [PHP] CMS Systems

2007-05-07 Thread Greg Donald

On 5/7/07, Joey <[EMAIL PROTECTED]> wrote:

Does anyone know of any good open source CMS system? ( content management
system )


http://www.opensourcecms.com/



--
Greg Donald
http://destiney.com/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] CMS Systems

2007-05-07 Thread Jim Lucas

Joey wrote:

Does anyone know of any good open source CMS system? ( content management
system )

 


Thanks!


Joey

 

 


Let me be the first to say.  Please search the archives of this mailing list

Secondly, http://www.google.com/search?q=php%20content%20management%20system

the first link in the un-paid results is a wonderful starting location to read about many many 
different CMS's.




--
Jim Lucas

   "Some men are born to greatness, some achieve greatness,
   and some have greatness thrust upon them."

Unknown

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] CMS Systems

2007-05-07 Thread straderb
My suggestion would be to check out http://www.cmsmatrix.org/ ... Very nice 
information on differant CMS systems.

Jim Lucas wrote ..
> Joey wrote:
> > Does anyone know of any good open source CMS system? ( content management
> > system )
> > 
> >  
> > 
> > Thanks!
> > 
> > 
> > Joey
> > 
> >  
> > 
> >  
> > 
> Let me be the first to say.  Please search the archives of this mailing
> list
> 
> Secondly, http://www.google.com/search?q=php%20content%20management%20system
> 
> the first link in the un-paid results is a wonderful starting location
> to read about many many 
> different CMS's.
> 
> 
> 
> -- 
> Jim Lucas
> 
> "Some men are born to greatness, some achieve greatness,
> and some have greatness thrust upon them."
> 
> Unknown
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> -- 
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] CMS Systems

2007-05-07 Thread Daniel Brown

   Or, if you want something extensible with a lot of modules, some good
suggestions that are well-supported by the community (and even paid
integrators, designers, and developers) would be Joomla, postNuke, and
others.  They're all 100% free and open source for commercial and
non-commercial usage alike.

On 5/7/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:


My suggestion would be to check out http://www.cmsmatrix.org/ ... Very
nice information on differant CMS systems.

Jim Lucas wrote ..
> Joey wrote:
> > Does anyone know of any good open source CMS system? ( content
management
> > system )
> >
> >
> >
> > Thanks!
> >
> >
> > Joey
> >
> >
> >
> >
> >
> Let me be the first to say.  Please search the archives of this mailing
> list
>
> Secondly,
http://www.google.com/search?q=php%20content%20management%20system
>
> the first link in the un-paid results is a wonderful starting location
> to read about many many
> different CMS's.
>
>
>
> --
> Jim Lucas
>
> "Some men are born to greatness, some achieve greatness,
> and some have greatness thrust upon them."
>
> Unknown
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
> --
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.

--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php





--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107


Re: [PHP] CMS Systems

2007-05-07 Thread Richard Lynch
On Mon, May 7, 2007 2:46 pm, Joey wrote:
> Does anyone know of any good open source CMS system? ( content
> management
> system )

http://google.com/
knows LOTS of them...

:-)

There's even one site that lets you try out a bunch of them without
doing your own install.

Seriously, you're not going to get a better answer than this unless
you at least come up with a list of "must have" features by studying
all the available CMS and figuring out what you love/hate about them.

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] PHP4 and SQLite

2007-05-07 Thread Suhas Pharkute

HI,

Can someone please point me to a tutorial for PHP4.x.x and SQLite
installation on Windows with Apache web server?

I searched in Google and PHP mailing list but nothing useful. It seems like
I am missing php_pdo.dll for 4.1.1 version.

Can someone please help?

Thanks in advance,
Suhas


Re: [PHP] PHP 5.2.2 - Undefined Function mysql_connect()

2007-05-07 Thread Richard Lynch
Compare what  says is REALLY your extension dir with
what you think is your extension dir...

On Mon, May 7, 2007 6:12 am, Jason Paschal wrote:
> I use this setup locally for testing/playing.  I recently installed
> the
> latest and greatest of the AMP collection.
>
> Apache 2.2.4
> PHP 5.2.2
> MySQL 5.0.37
>
> Apache and PHP work fine together, but I wanted to hook it up to a
> local
> test database, so  I installed MySQL.
>
> In php.ini, i have:
>
> ; Directory in which the loadable extensions (modules) reside.
> extension_dir = "C:\PHP"
>
> i made sure that i moved the dll to that folder, just like i did with
> the gd
> dll.
>
> And then i uncommented this line:
>
> extension=php_mysql.dll
>
> I restarted Apache, and ran a simple test script:
>
>  ini_set("display_errors","1");
> $cn = mysql_connect("localhost","root","password");
> ?>
>
> and I get the error:
>
> *Fatal error*: Call to undefined function mysql_connect()
>
> any ideas?
>
> thanks in advance,
> jason
>


-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] losing session variable

2007-05-07 Thread Richard Lynch


On Sun, May 6, 2007 11:29 am, Alain Roger wrote:
> Hi,
>
> I have the following code :
>
> session_start();
>> $_SESSION['username']=$myusername;
>> $_SESSION['Localization'] = $lang;

Add this:
session_write_close();
before you do header re-direct.

>> header("Location:
>> https://".$_SERVER['SERVER_NAME'].$path_adm_files."/modules/welcome/welcome.php");
>>
>
> if i check before header command what is the value of
> $_SESSION['username'],
> i get the right value.
> however, if i place on the first line of welcome.php file the
> following code
> :
>
> echo "1. Before session";

session_start() sends out a Cookie (depending on php.ini settings) and
you can't send a cookie header after content body.

http://php.net/session_start

>> session_start();
>> echo"Username : ".$_SESSION['username'];
>> echo "2. After session";
>>
>
> i get empty value for this session variable.
> How is it possible ?
>
> in my first code piece, if i use localhost instead of
> $_SERVER['SERVER_NAME'], it creates a session file in my temporary
> folder as
> it should be
> I'm confused now :-(
>
> thanks a lot for your help.
> --
> Alain
> 
> Windows XP SP2
> PostgreSQL 8.1.4
> Apache 2.2.4
> PHP 5.2.1
>


-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Removing commas from number

2007-05-07 Thread Richard Lynch


On Sun, May 6, 2007 10:33 am, Todd Cary wrote:
> Thanks to the suggestions, I use number_format($my_number, 2) to
> format the
> number in an edit field.  Now I need to reenter it into MySQL.  How
> should I use
> preg_replace to remove the commas?
>
> This removes the commas *and* the decimal point:
>
> preg_replace('/\D/', '', $str)
>
> In reviewing patterns, I cannot find the purpose of the "/" character
> in the above.

//to JUST replace the comma:
$str = str_replace(',', $str);

The '/' is not part of the pattern, but a delimiter to set pattern
separate from modifiers.
http://php.net/pcre

You could also do something not unlike:

$str = preg_replace("|[^0-9\\.-]|', '', $str);

Here I chose '|' for the delimiter instead of '/' because I felt like it.

You can choose different things in different circumstances being easier.

If '/' is actually IN the pattern, it's clunky as a delimiter because
you then have to escape it in the pattern.

By forcing the data to ONLY contain 0-9 . and - you pretty much
drastically increase the odds that any other stray typo won't get
through.

You could also consider testing with 'is_numeric' to rule out goofy
things like:
5.2.2
which is probably not valid input for what you are doing, but does
pass the pattern I've listed...

Or, you could try a more specific pattern:

|-?[0-9]*(\\.[0-9]{2})?|

which I *think* means:

A leading -, maybe
Any number of 0-9 digits
A period *and* 2 more digits, or nothing

This still doesn't guarantee valid input, though, as '' passes this
pattern :-v

The trick is to be as precise as you can about what you accept,
without rejecting anything that is valid.

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Feisty Fawn and apt-get

2007-05-07 Thread Richard Lynch


On Sat, May 5, 2007 9:27 pm, Mike Shanley wrote:
>
> Davi wrote:
>> First: use aptitude instead apt-get... =]
>> Second: use an debian-list to debian's questions instead an
>> php-list... =]
>>
> Third: Go Feisty!!!

Fourth: Go
http://www.listentofeist.com/

:-)

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mail() only working with php-cli

2007-05-07 Thread Richard Lynch
On Sat, May 5, 2007 3:53 pm, Andy B. wrote:
> Is there any way to debug the mail() function within PHP4 or PHP5?

Check Apache error logs.
Check sendmail (or whatever) error logs.

> The following code is not working when called from a browser, but it
> does
> work from the command line:

Often points to a paths/permissions problem...

Can you 'su' to the Apache/PHP User and *then* run sendmail on command
line?

> php and php-cli use the same php.ini file. Php via Apache is launched
> as a
> module, NOT as CGI!
>
> sendmail_path is correctly set to /usr/sbin/sendmail -t -i

You put quotes around that in  php.ini, right?...

Cuz it needs the quotes, last I checked:

sendmail_path = "/usr/sbin/sendmail -t -i"

> the /var/log/mail.log only shows activity when I try my code via
> command
> line, so my best guess is that sendmail is never reached when run from
> the
> browser.
>
> I went a little deeper and modified the sendmail_path to /tmp/test.sh,
> which
> contains:
>
> #!/bin/bash
> echo "I was used!!" > /tmp/test.log
>
> (chmod 777 /tmp/test.sh)
>
> Again I tried my script from the web and from the command line. Same
> result... command line is fine and generates the test.log file. In the
> browser no log file is created.

Hmmm.  That blows away the quotes as an issue, at least until you got
back to using multi-word path...

Was sendmail installed when you compiled PHP, so PHP "knows" that it
should be able to use it?
Or, the short version of that question:
Does  show you 'mail' as an installed extension?

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] mail() only working with php-cli

2007-05-07 Thread Richard Lynch
On Sat, May 5, 2007 5:04 pm, Andy B. wrote:
> Both are exactly the same, as I copied the CLI version into the Apache
> Version. Of course I first tested with the original Apache php.ini
> before
> overwriting it with the CLI version.

I'm not quite sure what you are saying here, but the CLI version is,
like, just 'php' and the Apache Module version is, like, 'libphp4.so'
and you can't just swap those two binaries, almost for sure...

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Why create_element function always return false?

2007-05-07 Thread Richard Lynch


On Fri, May 4, 2007 9:44 pm, Victor wrote:
>  $doc = domxml_new_doc("1.0");

var_dump($doc);

> $node = $doc->create_element("para");

var_dump($node);

> $newnode = $doc->append_child($node);

var_dump($newnode);

> $newnode->set_attribute("align", "left");
> ?>
>
> I just run the example that is from php manual. But there is some
> error

Presumable http://php.net/domxml_new_doc documents what happens when
there is an error, and how to deal with it.

The PHP samples are just that:  samples

You have to add about 5 X as much code to have a robuts error-handling
won't make your life miserable application...

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Newbie Question - Form To Email Needed

2007-05-07 Thread Richard Lynch
On Fri, May 4, 2007 9:23 pm, revDAVE wrote:
> I have a form on page one - and would like to submit to a second page
> in PHP
> that could grab the fields and send it out as an e-mail.
>
> Are there any links that show how do this?

http://php.net/faq.php

Somewhere in there is a question about processing form mail, with
sample, as I recall.

You also should be able to find a few thousand examples in Google.

I suspect:
http://php.net/mail
also has examples and discussion in the "mail" function link.

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP4 and SQLite

2007-05-07 Thread Richard Lynch
On Mon, May 7, 2007 5:29 pm, Suhas Pharkute wrote:
> Can someone please point me to a tutorial for PHP4.x.x and SQLite
> installation on Windows with Apache web server?
>
> I searched in Google and PHP mailing list but nothing useful. It seems
> like
> I am missing php_pdo.dll for 4.1.1 version.

First, make sure PDO was available for 4.1.1 at:
http://php.net/pdo

Even if it *was* it may not have made it into the Windows version...

Upgrade?

The instructions mostly consist of "find the php_pdo.dll" in your zip
file and "put it in the right place" where http://php.net/phpinfo says
is your extension_dir

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: CMS Systems

2007-05-07 Thread itoctopus
I use wordpress, easy, clean, and lots of plugins.
Joomla is also good.

-- 
itoctopus - http://www.itoctopus.com
""Joey"" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> Does anyone know of any good open source CMS system? ( content management
> system )
>
>
>
> Thanks!
>
>
> Joey
>
>
>
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP4 and SQLite

2007-05-07 Thread Suhas Pharkute

Yep, PDO was one more question that I had and could not find dll for it.

Upgrade is an option but there are some custom dlls that we developed for
4.1.1 and do not want to spend time in checking it for higher version. But
if it is not possible then I guess we will do that

Thx
SUhas


On 5/7/07, Richard Lynch <[EMAIL PROTECTED]> wrote:


On Mon, May 7, 2007 5:29 pm, Suhas Pharkute wrote:
> Can someone please point me to a tutorial for PHP4.x.x and SQLite
> installation on Windows with Apache web server?
>
> I searched in Google and PHP mailing list but nothing useful. It seems
> like
> I am missing php_pdo.dll for 4.1.1 version.

First, make sure PDO was available for 4.1.1 at:
http://php.net/pdo

Even if it *was* it may not have made it into the Windows version...

Upgrade?

The instructions mostly consist of "find the php_pdo.dll" in your zip
file and "put it in the right place" where http://php.net/phpinfo says
is your extension_dir

--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?




[PHP] Solution For Undefined Function mysql_connect()

2007-05-07 Thread Jason Paschal

SOLUTION FOUND!

i copied libmysql.dll and php_mysql.dll to my c:\windows\ folder

suddenly my script connects.  that's all it took.

my extension directory is set to C:\PHP in php.ini, but for some reason,
placing the dlls in
the windows folder did the trick.  i searched httpd.conf and php.ini for
"WINDOWS" and did not find
a reference, but it works.

thank you for taking the time to help.  maybe this info can help you or

someone you know.


On 5/7/07, Richard Lynch <[EMAIL PROTECTED]> wrote:


Compare what  says is REALLY your extension dir with
what you think is your extension dir...

On Mon, May 7, 2007 6:12 am, Jason Paschal wrote:
> I use this setup locally for testing/playing.  I recently installed
> the
> latest and greatest of the AMP collection.
>
> Apache 2.2.4
> PHP 5.2.2
> MySQL 5.0.37
>
> Apache and PHP work fine together, but I wanted to hook it up to a
> local
> test database, so  I installed MySQL.
>
> In php.ini, i have:
>
> ; Directory in which the loadable extensions (modules) reside.
> extension_dir = "C:\PHP"
>
> i made sure that i moved the dll to that folder, just like i did with
> the gd
> dll.
>
> And then i uncommented this line:
>
> extension=php_mysql.dll
>
> I restarted Apache, and ran a simple test script:
>
>  ini_set("display_errors","1");
> $cn = mysql_connect("localhost","root","password");
> ?>
>
> and I get the error:
>
> *Fatal error*: Call to undefined function mysql_connect()
>
> any ideas?
>
> thanks in advance,
> jason
>


--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?





--
Crunchmutt Studios
Latest News Headlines: http://www.rssvideonews.com
http://www.crunchmutt.com
http://www.deadjoe.com
http://www.dailymedication.com
http://www.extremesportclips.com
http://www.coolanimalclips.com
http://www.robotclips.com
http://www.newsfinger.com
http://www.postyourimage.com
http://www.nakedalarmclock.com


[PHP] How to know a requets from web page or client.

2007-05-07 Thread Le Phuoc Canh
Dear all,
How can we know a request from web page( ex : firefox, IE..) or from client(
ex : window media, winamp, ...). Please help me !
 
Thanks & Best Regard.
 
Le Phuoc Canh
 
Arrive Techologies
Cell Phone : 0902147449
Home Phone  : (08)9915349
Email: [EMAIL PROTECTED]
 


RE: [PHP] mail() only working with php-cli

2007-05-07 Thread Andy B.
Thanks a lot for helping.

I found the problem while trying so su to the www-user, where I was
immediately told "/bin/bash: permission denied". Rather unusual...

The owner of the server has mistakenly changed many permissions in the
/(s)bin, /usr/(s)bin directories, so that most of the files were chmod 700
instead of 755. The suid flags were also gone.

It took me a while to rebuild the permissions, but after that mail() worked
as it should.

That being said, it really would have saved me a lot of time and anger if
mail() were a little bit more verbose in situations like that. A simple
error message like "/usr/sbin/sendmail: permission denied" would have made
it.

Regards,


Andy

-Original Message-
From: Richard Lynch [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, May 08, 2007 01:01
To: Andy B.
Cc: php-general@lists.php.net
Subject: Re: [PHP] mail() only working with php-cli

On Sat, May 5, 2007 3:53 pm, Andy B. wrote:
> Is there any way to debug the mail() function within PHP4 or PHP5?

Check Apache error logs.
Check sendmail (or whatever) error logs.

> The following code is not working when called from a browser, but it
> does
> work from the command line:

Often points to a paths/permissions problem...

Can you 'su' to the Apache/PHP User and *then* run sendmail on command
line?

> php and php-cli use the same php.ini file. Php via Apache is launched
> as a
> module, NOT as CGI!
>
> sendmail_path is correctly set to /usr/sbin/sendmail -t -i

You put quotes around that in  php.ini, right?...

Cuz it needs the quotes, last I checked:

sendmail_path = "/usr/sbin/sendmail -t -i"

> the /var/log/mail.log only shows activity when I try my code via
> command
> line, so my best guess is that sendmail is never reached when run from
> the
> browser.
>
> I went a little deeper and modified the sendmail_path to /tmp/test.sh,
> which
> contains:
>
> #!/bin/bash
> echo "I was used!!" > /tmp/test.log
>
> (chmod 777 /tmp/test.sh)
>
> Again I tried my script from the web and from the command line. Same
> result... command line is fine and generates the test.log file. In the
> browser no log file is created.

Hmmm.  That blows away the quotes as an issue, at least until you got
back to using multi-word path...

Was sendmail installed when you compiled PHP, so PHP "knows" that it
should be able to use it?
Or, the short version of that question:
Does  show you 'mail' as an installed extension?

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] How to know a requets from web page or client.

2007-05-07 Thread Jim Lucas

Le Phuoc Canh wrote:

Dear all,
How can we know a request from web page( ex : firefox, IE..) or from client(
ex : window media, winamp, ...). Please help me !
 
Thanks & Best Regard.
 
Le Phuoc Canh
 
Arrive Techologies

Cell Phone : 0902147449
Home Phone  : (08)9915349
Email: [EMAIL PROTECTED]
 

some will say that it is unreliable/unsafe/inconsistent/etc...  whatever 
else they can come up with, but...


$_SERVER['HTTP_USER_AGENT'] should give you insight into what you are 
looking for.


It should contain a unique description for the above listed agents.

Jim

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] How to know a requets from web page or client.

2007-05-07 Thread clive

Le Phuoc Canh wrote:


How can we know a request from web page( ex : firefox, IE..) or from client(
ex : window media, winamp, ...). Please help me !


you need to look at the http request header, you can use the 
$_SERVER['HTTP_USER_AGENT'] variable to access that.


Please note some application may provide a false identity, ie Opera 
identifying itself as IE.



--
Regards,

Clive.

Real Time Travel Connections


{No electrons were harmed in the creation, transmission or reading of 
this email. However, many were excited and some may well have enjoyed 
the experience.}


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php