php-general Digest 3 Nov 2006 16:49:06 -0000 Issue 4438
Topics (messages 244121 through 244158):
Re: Mac PHP & MySQL
244121 by: Wee Keat Chin
244131 by: Ed Lazor
244136 by: Johan Martin
Re: WAP?
244122 by: Paul Scott
244125 by: tg-php.gryffyndevelopment.com
244138 by: Aarno Syvänen
244139 by: clive
Re: Viruses
244123 by: Rasmus Lerdorf
244126 by: tg-php.gryffyndevelopment.com
244127 by: tg-php.gryffyndevelopment.com
244128 by: tg-php.gryffyndevelopment.com
244129 by: tg-php.gryffyndevelopment.com
Re: why so slow?
244124 by: Mel
244137 by: clive
Use of substr()
244130 by: jekillen
244133 by: Chris
244135 by: Shuping Zhou
Why a script belong to user 'root' and the folder this script create is
belonged to user 'nobody'?
244132 by: John.H
244134 by: Chris
Re: Frameworks
244140 by: Tony Marston
Re: str_replace on words with an array
244141 by: Dotan Cohen
244150 by: Roman Neuhauser
Finding user's timezone
244142 by: Dotan Cohen
244143 by: André Medeiros
244144 by: Stut
244145 by: Dotan Cohen
244146 by: Stut
244147 by: Dotan Cohen
244148 by: Stut
244151 by: Pawel Miroslawski
244155 by: Edward Kay
setlocale madness... please help!
244149 by: Jochem Maas
244153 by: Roman Neuhauser
244154 by: Jochem Maas
244157 by: Roman Neuhauser
open source zip code geographical drill down
244152 by: Ben Liu
File Repository / Managment Software
244156 by: Prathaban Mookiah
Re: How to Display a page while script runs?
244158 by: tedd
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 ---
Ed,
Ed Lazor wrote:
I'm trying to configure and compile PHP 5. The configure is failing to
find the MySQL UNIX socket. Any ideas?
I can't tell you why because I have not a clue, but why don't you try
using MAMP (http://www.living-e.de/en/products/The-MAMP/download.php)
and you can then switch between PHP4 AND 5?
--
Wee Keat Chin
--- End Message ---
--- Begin Message ---
Very very nice. I'm impressed with how easy everything was to
setup. I keep wondering why nobody at PHP/MySQL/Apache ever sets up
stuff like this.
On Nov 2, 2006, at 8:40 PM, Wee Keat Chin wrote:
Ed,
Ed Lazor wrote:
I'm trying to configure and compile PHP 5. The configure is
failing to find the MySQL UNIX socket. Any ideas?
I can't tell you why because I have not a clue, but why don't you
try using MAMP (http://www.living-e.de/en/products/The-MAMP/
download.php) and you can then switch between PHP4 AND 5?
--
Wee Keat Chin
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
On 02 Nov 2006, at 5:11 PM, Ed Lazor wrote:
I'm trying to configure and compile PHP 5. The configure is
failing to find the MySQL UNIX socket. Any ideas?
./configure \
--with-apxs2=/usr/local/apache2/bin/apxs \
--with-zlib \
--with-mysql=/usr/local/mysql \
--with-mysql-socket=/tmp
I had a similar problem and downloaded the tar version of the Mac OS
X Mysql Server. Pointed --with-mysql= to the libraries and that
folder and it worked. Decided to compile my own because the packages
always seem to lag behind the released versions of the software. Also
need both postgresql and mysql support.
Johan Martin
Catenare LLC
534 Pacific Ave
San Francisco, CA. 94133
Phone: (415) 834-9802
Fax: (415) 294-4495
http://www.catenare.com
AOL: catenarellc
Yahoo: martin_johan
GTalk: [EMAIL PROTECTED]
FreeWorldDialup :716798 - http://www.freeworlddialup.com/
Gizmo Project: 747-627-9132 - http://www.gizmoproject.com/
http://www.linkedin.com/in/catenare
--- End Message ---
--- Begin Message ---
On Thu, 2006-11-02 at 17:11 -0500, [EMAIL PROTECTED] wrote:
> http://www.w3schools.com/wap/
Also, don't forget hawhaw. I think it lives at http://www.hawhaw.de or
something.
--Paul
All Email originating from UWC is covered by disclaimer
http://www.uwc.ac.za/portal/uwc2006/content/mail_disclaimer/index.htm
--- End Message ---
--- Begin Message ---
Ah.. grat pull! I did forget about that one. Good stuff, thanks! And yes,
that appears to be the address.
= = = Original message = = =
On Thu, 2006-11-02 at 17:11 -0500, [EMAIL PROTECTED] wrote:
> http://www.w3schools.com/wap/
Also, don't forget hawhaw. I think it lives at http://www.hawhaw.de or
something.
--Paul
All Email originating from UWC is covered by disclaimer
http://www.uwc.ac.za/portal/uwc2006/content/mail_disclaimer/index.htm
___________________________________________________________
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.
--- End Message ---
--- Begin Message ---
Perhaps you should start at http://www.kannel.org
Aarno
On 02 Nov 2006, at 22:02, Richard Lynch wrote:
So today I was tasked with converting a PHP SMS solution to a PHP WAP
solution...
My first attempt at running through a Zend tutorial from 2000 was of
limited success...
Apparently, the card tag has gone the way of the dodo or something...
Went looking for the php-wap list at php.net/mailing-lists.php and I
guess it's not there...
I'm about to make some more tries at all this after a meeting with the
boss, and will probably eventually stumble across a good
resource/site/list for PHP+WAP, but...
Anybody want to nudge me in the right general direction?...
Thanks!
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving 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
--- End Message ---
--- Begin Message ---
Richard Lynch wrote:
Anybody want to nudge me in the right general direction?...
WAP 1.2.1 (not sure of the last version number ) is dead. Dont even
bother with WAP 1.
WAP 2 is based on XHTML MP, thats xhtml mobile profile. Most newer
phones are in some way compliant with WAP 2. What I mean is they will
all display correctly, but things like file uploads aren't implemented
on all phones.
Some people may say that WAP 1 was more compact and efficient than the
latest version, but remember phones now use 3G, HSDPA etc instead of
grps/edge, so I don't think thats a valid argument anymore, unless your
accessing a wap page with brick.
clive
Thanks!
--- End Message ---
--- Begin Message ---
Beauford wrote:
> Does the PHP list not monitor spam or filter out viruses? I am getting a lot
> of this junk coming through the list. I am also getting some directly to
> this address, but obviously that is out of the lists control.
We filter 1000's of spam messages every day. But a few do get through.
Some spammer manually validate their addresses and then spam. It's
very difficult to stop those.
-Rasmus
--- End Message ---
--- Begin Message ---
As Rasmus said, they filter as much as they can on the list.
But consider this... if someone's machine is infected and they below to this
email list, it can harvest your email address and either spam (or send malware)
from their PC to you or send your email address to somewhere else where it can
be used as a To: field for spam/virus/trojan/whatever emails.
Some items that appear to be coming from the list may not be going through
PHP-General's list serv at all, therefore they may have zero control over
whether you receive it or not.
Unfortunate reality of today's online universe.
-TG
= = = Original message = = =
Does the PHP list not monitor spam or filter out viruses? I am getting a lot
of this junk coming through the list. I am also getting some directly to
this address, but obviously that is out of the lists control.
Thanks
B
___________________________________________________________
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.
--- End Message ---
--- Begin Message ---
As Rasmus said, they filter as much as they can on the list.
But consider this... if someone's machine is infected and they below to this
email list, it can harvest your email address and either spam (or send malware)
from their PC to you or send your email address to somewhere else where it can
be used as a To: field for spam/virus/trojan/whatever emails.
Some items that appear to be coming from the list may not be going through
PHP-General's list serv at all, therefore they may have zero control over
whether you receive it or not.
Unfortunate reality of today's online universe.
-TG
= = = Original message = = =
Does the PHP list not monitor spam or filter out viruses? I am getting a lot
of this junk coming through the list. I am also getting some directly to
this address, but obviously that is out of the lists control.
Thanks
B
___________________________________________________________
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.
--- End Message ---
--- Begin Message ---
As Rasmus said, they filter as much as they can on the list.
But consider this... if someone's machine is infected and they below to this
email list, it can harvest your email address and either spam (or send malware)
from their PC to you or send your email address to somewhere else where it can
be used as a To: field for spam/virus/trojan/whatever emails.
Some items that appear to be coming from the list may not be going through
PHP-General's list serv at all, therefore they may have zero control over
whether you receive it or not.
Unfortunate reality of today's online universe.
-TG
= = = Original message = = =
Does the PHP list not monitor spam or filter out viruses? I am getting a lot
of this junk coming through the list. I am also getting some directly to
this address, but obviously that is out of the lists control.
Thanks
B
___________________________________________________________
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.
--- End Message ---
--- Begin Message ---
As Rasmus said, they filter as much as they can on the list.
But consider this... if someone's machine is infected and they below to this
email list, it can harvest your email address and either spam (or send malware)
from their PC to you or send your email address to somewhere else where it can
be used as a To: field for spam/virus/trojan/whatever emails.
Some items that appear to be coming from the list may not be going through
PHP-General's list serv at all, therefore they may have zero control over
whether you receive it or not.
Unfortunate reality of today's online universe.
-TG
= = = Original message = = =
Does the PHP list not monitor spam or filter out viruses? I am getting a lot
of this junk coming through the list. I am also getting some directly to
this address, but obviously that is out of the lists control.
Thanks
B
___________________________________________________________
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.
--- End Message ---
--- Begin Message ---
Thank you both so much. I did change the name. I was chocked to see
all my passwords displayed in the browser!
On Nov 2, 2006, at 1:15 PM, Dave Goodchild wrote:
Better still, keep them outside the docroot. If you do insist on
having them
inside and insist on calling them *.inc, create an .htaccess file
that stops
download of *.inc files.
--- End Message ---
--- Begin Message ---
Mel wrote:
I do have a book with the help of which I made this site and I have been
working on it for many many weeks. (ashamed to say exactly how many!)
Remember your first ever php site?
No
I am sure there are things even you don't know or understand and that
you can use help from other more experienced and generous people who are
willing to share.
true, but imagine people started asking about the sytanx for the echo
command, chaos I tell you. I aways google on google and search on other
search engines first.
--- End Message ---
--- Begin Message ---
Hello all;
I am scratching my head over the following:
I have written code that is supposed to format text
sent from a form in a textarea form element.
This text does not have new lines added if
the text is allowed to automatically wrap to the
next line. I want to automatically add new lines
to this input at appropriate locations.
Here is the code I wrote:
(It is in early stages of development)
function format_text($a, $b) // $a is text to format, from textarea, $b
is line length
{ $line = array();
$limit = (strlen($a)/$b);
for($i = 0; $i < $limit; $i++)
{
$start = $i*$b;
$stop = (($i*$b) + $b) - 1;
print "start : $start stop : $stop<br>";
array_push($line, substr($a, $start,
$stop)); // separate into lines not greater than $b length
}
return $line;
}
Here is what is entered in a test run:
(actual text has no new lines, I added them here)
Then let us test a long string that spans more than the line length of
the text area field.
This is the way I practice both writing and typing. If I could only get
by the booby traps
and land mines with my typing, I could get somewhere.
This is output code:
if($_POST['input'])
{print strlen($_POST['input']);
print'<br>';
$output = array();
$output = format_text($_POST['input'], 60);
for($i = 0; $i < count($output); $i++)
{ print "$i :".$output[$i].'<br>'; }
}
Here is what comes out the other end:
239
start : 0 stop : 59
start : 60 stop : 119
start : 120 stop : 179
start : 180 stop : 239
0 :Then let us test a long string that spans more than the lin
1 : length of the text area field. This is the way I practice both
writing and typing. If I could only get by the booby tr
2 :oth writing and typing. If I could only get by the booby traps and
land mines with my typing, I could get somewhere.
3 :ps and land mines with my typing, I could get somewhere.
// e is missing from end of line 0
// portions of the text are repeated out of sequence.
The questions I have are:
What does the browser actually do when it automatically wraps textarea
input?
What could explain the scrambled result?
Thanks much to anyone taking the time:
Jeff K
--- End Message ---
--- Begin Message ---
jekillen wrote:
Hello all;
I am scratching my head over the following:
I have written code that is supposed to format text
sent from a form in a textarea form element.
This text does not have new lines added if
the text is allowed to automatically wrap to the
next line. I want to automatically add new lines
to this input at appropriate locations.
Why don't you use the wordwrap() function built into php?
php.net/wordwrap - you can set the length etc of each line you want.
--
Postgresql & php tutorials
http://www.designmagick.com/
--- End Message ---
--- Begin Message ---
function format_text($a, $b) // $a is text to format, from textarea, $b
is line length
{ $line = array();
$limit = (strlen($a)/$b);
for($i = 0; $i < $limit; $i++)
{
$start = $i*$b;
$stop = (($i*$b) + $b) - 1;
print "start : $start stop : $stop<br>";
array_push($line, substr($a, $start,
$stop)); // separate into lines not greater than $b length
}
return $line;
}
You made a minor mistake:) substr takes length as its third parameter,
not stop.
Here is the prototype of substr():
string *substr* ( string string, int start [, int length] ),
--- End Message ---
--- Begin Message ---
My php program whose owner is root:
<?
mkdir('test',0777);
?>
and the folder 'test' 's owner is 'nobody'?
why?should the folder belong to 'root' too?
By the way,the safe mode is turned on.
--- End Message ---
--- Begin Message ---
John.H wrote:
My php program whose owner is root:
<?
mkdir('test',0777);
?>
and the folder 'test' 's owner is 'nobody'?
why?should the folder belong to 'root' too?
By the way,the safe mode is turned on.
If you're running this through your webserver, then the webserver is
actually executing the script, not the "owner" of the script.
So apache is running as 'nobody', the script executes, all commands the
script makes are done as 'nobody'.
--
Postgresql & php tutorials
http://www.designmagick.com/
--- End Message ---
--- Begin Message ---
It totally depends on what type of application you are writing, and what
features you want "out of the box" so that you don't have to design and
write them yourself.
For example, if you are writing an administrative web application and you
want user authentication, dynamic menus, role based access control, audit
logging without database triggers, built-in workflow, and
internationalisation facilities then you might want to take a look at
Radicore (http://www.radicore.org/)
As well as having all the above features it has a custom built Data
Dictionary which can generate all the basic code for you. This enables you
to start with nothing more than a database schema which you then import into
the Data Dictionary, and from there you can press buttons to generate the
database table classes and also buttons to generate the scripts to view and
maintain those tables. All this without having to write a single line of
code. It uses a catalog of transaction patterns which deal with single
tables, one-to-many relationships and even many-to-many relationships.
There is a massive amount of documentation and sample code, and a tutorial
is available at http://www.tonymarston.net/php-mysql/radicore-tutorial.html
--
Tony Marston
http://www.tonymarston.net
http://www.radicore.org
<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>I know this subject has been covered in the past, but my question is why
> use them? I'm hoping to not create a religious war... I see that
> frameworks would probably help you develop some things faster, but most
> of the time they don't do the things the way I would want them to work.
> If I did use one, it almost seems like I would use it to get through
> something until I had time to do things the way I wanted/needed to do
> them. There's a lot of talk about frameworks lately, and especially
> the Zend Framework, so I'd like to look into what it's all about. I
> think I might be missing out the framework issue, so I'd like to hear
> other people's opinions.
>
> I do like the mail, pdf, and a few other parts of the Zend Framework. I
> also like that it's more like a set of tools than a monolithic beast
> that would take a lot of memory just to load up into your application.
>
> Your thoughts?
>
> Thanks,
> Ray
--- End Message ---
--- Begin Message ---
On 31/10/06, Larry Garfield <[EMAIL PROTECTED]> wrote:
From your original message, it sounds like you want to strip selected complete
words, not substrings, from a string for indexing or searching or such.
Right?
I think that was my mistake- not differentiating between the two.
Symbols and such I wanted to replace as substrings, yet noise words I
wanted to replace as words. Now that I've created two arrays, one with
symbols and one with noise words, things are on track.
Try something like this:
$string = "The quick sly fox jumped over a fence and ran away";
$words = array('the', 'a', 'and');
function make_regex($str) {
return '/\b' . $str . '\b/i';
}
$search = array_map('make_regex', $words);
$string = preg_replace($search, '', $string);
print $string . "\n";
I was completely unaware of the array_map function. Thank you- that is
exactly what I needed.
What you really need to do that is to match word boundaries, NOT string
boundaries. So you take your list of words and mutate *each one* (that's
what the array_map() is about) into a regex pattern that finds that word,
case-insensitively. Then you use preg_replace() to replace all matches of
any of those patterns with an empty string.
Yep.
You were close. What you were missing was the array_map(), because you needed
to concatenate stuff to each element of the array rather than trying to
concatenate a string to an array, which as others have said will absolutely
not work.
Yep.
I can't guarantee that the above code is the best performant method, but it
works. :-)
It certainly does. Of course I'm not using it exactly how you pasted
it, but you got me on track. Thank you very much.
To all others who took part in this thread: I was unclear on another
point as well, the issue of sql-injection. As I'm removing the
symbols, signs, and other non-alpha characters from the query, I
expect it to be sql-injection proof. As I wrong? ie, could an attacker
successful inject sql if he has nothing but alpha characters at his
disposal? I think not, but I'd like to hear it from someone with more
experience than i.
Thank you.
Dotan Cohen
http://what-is-what.com
--- End Message ---
--- Begin Message ---
# [EMAIL PROTECTED] / 2006-10-30 21:18:33 +0000:
> Dotan Cohen wrote:
> > $searchQuery=str_replace( "^".$noiseArray."$", " ", $searchQuery);
>
> Ok, this is what the compiler will see...
>
> $searchQuery=str_replace("^Array$", " ", $searchQuery);
>
> Yes, that's a literal Array in the string. You cannot, and you should
> remember this, you cannot concatenate strings and arrays. What would you
> expect it to do?
DTRT? This is what e. g. zsh does with the right configuration:
[EMAIL PROTECTED] ~ 1108:0 > echo x-{aa,bb,cc}-y
x-aa-y x-bb-y x-cc-y
--
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man. You don't KNOW.
Cause you weren't THERE. http://bash.org/?255991
--- End Message ---
--- Begin Message ---
How does php decide what timezone a user is in? Although I am in
Haifa, Israel (GMT+2), when I go to a page with date("e") I get
"America/New_York" displayed.
To confirm, could some users tell me what output they get on:
http://what-is-what.com/what_time_is_it.php
Let me know where you are in the world, and what timezone you are in
to confirm/ deny the correctness of the php date function. Any advise
on how to get the correct user's timezone would be most appreciated.
Note: I have considered matching the users' IP against a database, but
I'd prefer a simpler method, without the overhead of such a database.
Thanks in advance.
Dotan Cohen
http://what-is-what.com/
http://essentialinux.com/
--- End Message ---
--- Begin Message ---
The result of that function would depend on where the server is
installed, not where the client is accessing it from, right?
On 11/3/06, Dotan Cohen <[EMAIL PROTECTED]> wrote:
How does php decide what timezone a user is in? Although I am in
Haifa, Israel (GMT+2), when I go to a page with date("e") I get
"America/New_York" displayed.
To confirm, could some users tell me what output they get on:
http://what-is-what.com/what_time_is_it.php
Let me know where you are in the world, and what timezone you are in
to confirm/ deny the correctness of the php date function. Any advise
on how to get the correct user's timezone would be most appreciated.
Note: I have considered matching the users' IP against a database, but
I'd prefer a simpler method, without the overhead of such a database.
Thanks in advance.
Dotan Cohen
http://what-is-what.com/
http://essentialinux.com/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
André Medeiros wrote:
The result of that function would depend on where the server is
installed, not where the client is accessing it from, right?
Close but no cigar! It's how the server is configured, not where it is
installed. But essentially correct, the PHP datetime functions use the
server datetime not the client.
-Stut
On 11/3/06, Dotan Cohen <[EMAIL PROTECTED]> wrote:
How does php decide what timezone a user is in? Although I am in
Haifa, Israel (GMT+2), when I go to a page with date("e") I get
"America/New_York" displayed.
To confirm, could some users tell me what output they get on:
http://what-is-what.com/what_time_is_it.php
Let me know where you are in the world, and what timezone you are in
to confirm/ deny the correctness of the php date function. Any advise
on how to get the correct user's timezone would be most appreciated.
Note: I have considered matching the users' IP against a database, but
I'd prefer a simpler method, without the overhead of such a database.
Thanks in advance.
Dotan Cohen
http://what-is-what.com/
http://essentialinux.com/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
On 03/11/06, André Medeiros <[EMAIL PROTECTED]> wrote:
The result of that function would depend on where the server is
installed, not where the client is accessing it from, right?
That's not what php.net/date implies:
e: "Timezone identifier"
T : "Timezone setting of this machine"
If "T" is the timezone of the machine, then why have "e" if it's the same thing?
Dotan Cohen
http://technology-sleuth.com/
http://gmail-com.com/
--- End Message ---
--- Begin Message ---
Dotan Cohen wrote:
On 03/11/06, André Medeiros <[EMAIL PROTECTED]> wrote:
The result of that function would depend on where the server is
installed, not where the client is accessing it from, right?
That's not what php.net/date implies:
e: "Timezone identifier"
T : "Timezone setting of this machine"
If "T" is the timezone of the machine, then why have "e" if it's the
same thing?
They're not the same thing. The date_default_timezone_set() function
allows you to change the timezone that PHP will use. The 'T' option
bypasses that setting and gets the timezone as set on the machine.
Example: http://dev.stut.net/php/date.php
-Stut
--- End Message ---
--- Begin Message ---
On 03/11/06, M <[EMAIL PROTECTED]> wrote:
You can use javascript:
var Today = new Date();
alert(Today.toString());
just parse the output using regexp
Hmm, I suppose that I could use Javascript, but I'd rather do it all
serverside. Any other ideas on behalf of the think-tank that is this
list?
Dotan Cohen
http://what-is-what.com/what_is/love.html
--- End Message ---
--- Begin Message ---
Dotan Cohen wrote:
On 03/11/06, M <[EMAIL PROTECTED]> wrote:
You can use javascript:
var Today = new Date();
alert(Today.toString());
just parse the output using regexp
Hmm, I suppose that I could use Javascript, but I'd rather do it all
serverside. Any other ideas on behalf of the think-tank that is this
list?
There is no way to get the client date/time/timezone on the server-side
unless you have something on the client to give it to you, Javascript
being the obvious example.
-Stut
--- End Message ---
--- Begin Message ---
Hmm... in $_SERVER array you get a client IP so You know client coutry. if
exists a list of ip numbers and coutries should be exists list coutries and
timezones too, so it should be easy. Eventually you may create short list of
this countries what will be visitors from (or only biggest coutries).
--- End Message ---
--- Begin Message ---
> Hmm... in $_SERVER array you get a client IP so You know client coutry. if
> exists a list of ip numbers and coutries should be exists list
> coutries and
> timezones too, so it should be easy. Eventually you may create
> short list of
> this countries what will be visitors from (or only biggest coutries).
>
The IP address isn't very reliable though. Many global corporations only
have a couple of external gateways through which all traffic goes. A user in
the UK could very well have their visable IP address located in the US.
Edward
--- End Message ---
--- Begin Message ---
I have a debian box, I have just added a bunch of locales using the following
command:
dpkg-reconfigure locales
before I added more locales the only installed locale was '[EMAIL PROTECTED]'.
my php version is 5.1.2, now for the madness:
1. running the command 'locale -a' returns the following [shortened] list:
C
de_DE
dutch
en_GB
nl_NL
[EMAIL PROTECTED]
nl_NL.iso88591
[EMAIL PROTECTED]
nl_NL.utf8
[EMAIL PROTECTED]
POSIX
2. running the following from the commandline returns "en_GB" (meaning the
locale was set correctly)
php -r 'var_dump(set_locale(LC_ALL, "en_GB"))';
3. running the same code via the webbrowser (it is Apache2 and yes I have
restarted it!) always returns FALSE
(meaning the locale was not set correctly)
in fact I can set any installed locale I want on the commandline BUT trying to
set any other than the
originally installed "[EMAIL PROTECTED]" in code running via Apache results in
FALSE being returned and the locale not being
set.
has anybody got a clue for me?
TIA.
--- End Message ---
--- Begin Message ---
# [EMAIL PROTECTED] / 2006-11-03 14:51:39 +0100:
> 1. running the command 'locale -a' returns the following [shortened] list:
>
> C
> de_DE
> dutch
> en_GB
> nl_NL
> [EMAIL PROTECTED]
> nl_NL.iso88591
> [EMAIL PROTECTED]
> nl_NL.utf8
> [EMAIL PROTECTED]
> POSIX
>
> 2. running the following from the commandline returns "en_GB" (meaning
> the locale was set correctly)
>
> php -r 'var_dump(set_locale(LC_ALL, "en_GB"))';
>
> 3. running the same code via the webbrowser (it is Apache2 and yes I
> have restarted it!) always returns FALSE (meaning the locale was not
> set correctly)
what happens if you run locale -a from apache?
> in fact I can set any installed locale I want on the commandline BUT
> trying to set any other than the originally installed "[EMAIL PROTECTED]" in
> code running via Apache results in FALSE being returned and the locale
> not being set.
>
> has anybody got a clue for me?
You don't mention what warning(s) the failing setlocale() call produces.
--
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man. You don't KNOW.
Cause you weren't THERE. http://bash.org/?255991
--- End Message ---
--- Begin Message ---
hi Roman,
Roman Neuhauser wrote:
> # [EMAIL PROTECTED] / 2006-11-03 14:51:39 +0100:
>> 1. running the command 'locale -a' returns the following [shortened] list:
>>
>> C
>> de_DE
>> dutch
>> en_GB
>> nl_NL
>> [EMAIL PROTECTED]
>> nl_NL.iso88591
>> [EMAIL PROTECTED]
>> nl_NL.utf8
>> [EMAIL PROTECTED]
>> POSIX
>>
>> 2. running the following from the commandline returns "en_GB" (meaning
>> the locale was set correctly)
>>
>> php -r 'var_dump(set_locale(LC_ALL, "en_GB"))';
>>
>> 3. running the same code via the webbrowser (it is Apache2 and yes I
>> have restarted it!) always returns FALSE (meaning the locale was not
>> set correctly)
>
> what happens if you run locale -a from apache?
ah, I did check this. doing <?php system('locale -a'); ?> in a webpage
produces the same list as running it on the commandline.
>
>> in fact I can set any installed locale I want on the commandline BUT
>> trying to set any other than the originally installed "[EMAIL PROTECTED]" in
>> code running via Apache results in FALSE being returned and the locale
>> not being set.
>>
>> has anybody got a clue for me?
>
> You don't mention what warning(s) the failing setlocale() call produces.
it just returns false, telling me that the chosen locale(s) was/were not set -
there
is no PHP error at all.
>
--- End Message ---
--- Begin Message ---
# [EMAIL PROTECTED] / 2006-11-03 16:16:11 +0100:
> Roman Neuhauser wrote:
> > # [EMAIL PROTECTED] / 2006-11-03 14:51:39 +0100:
> >> 1. running the command 'locale -a' returns the following [shortened] list:
> >>
> >> C
> >> de_DE
> >> dutch
> >> en_GB
> >> nl_NL
> >> [EMAIL PROTECTED]
> >> nl_NL.iso88591
> >> [EMAIL PROTECTED]
> >> nl_NL.utf8
> >> [EMAIL PROTECTED]
> >> POSIX
> >>
> >> 2. running the following from the commandline returns "en_GB" (meaning
> >> the locale was set correctly)
> >>
> >> php -r 'var_dump(set_locale(LC_ALL, "en_GB"))';
> >>
> >> 3. running the same code via the webbrowser (it is Apache2 and yes I
> >> have restarted it!) always returns FALSE (meaning the locale was not
> >> set correctly)
> >
> > what happens if you run locale -a from apache?
>
> ah, I did check this. doing <?php system('locale -a'); ?> in a webpage
> produces the same list as running it on the commandline.
ok then
> >> in fact I can set any installed locale I want on the commandline BUT
> >> trying to set any other than the originally installed "[EMAIL PROTECTED]"
> >> in
> >> code running via Apache results in FALSE being returned and the locale
> >> not being set.
> >>
> >> has anybody got a clue for me?
> >
> > You don't mention what warning(s) the failing setlocale() call produces.
>
> it just returns false, telling me that the chosen locale(s) was/were not set
> - there
> is no PHP error at all.
I just checked the setlocale() code (in HEAD), and surely it can
return false without a warning, it can even be an almost empty (and
just as quiet) stub that just returns false, depending on the value
of HAVE_SETLOCALE during compilation.
So, before you go off recompiling mod_php with a few printf() and
perror() calls here and there, you should find out whether it's PHP
or Apache that makes the call fail. Try a simple CGI script, does
locale manipulation succeed there?
--
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man. You don't KNOW.
Cause you weren't THERE. http://bash.org/?255991
--- End Message ---
--- Begin Message ---
I'm trying to build some functionality commonly seen on the web where
a user enters a zip code and they are provided with a listing of
business or entity locations sorted by geographical distance. I've got
a client with a distributor network and I need to create something
like this for them. They want an end user to be able to enter a zip
code and have a list of closest distributors be listed. Anyone know of
any open source, free code to get this done. I have a zip code
database and can perform a query on it and return the relevant
records. I can even associate distributors with certain zip codes, but
the whole geographical distance thing is beyond me. Anybody do this
before and have advice? Thanks for any guidance here.
Regards,
Ben
--- End Message ---
--- Begin Message ---
Hello,
Is there a open source file repository / managment software written in PHP ?
I need to setup a file repository where everyone working in my group can
share their files in an organized manner. I am talking about something like
phpBB, but with file handling capabilities.
Thanks in advance.
--- End Message ---
--- Begin Message ---
At 4:46 PM -0500 11/2/06, Chris wrote:
I have a php script which takes maybe 15-20 seconds to run, however until it
completes a blank web page is displayed to the user. Is there a way/method
which would enable me to give some feedback to the user while the script is
running so the blank page is not displayed?
Best,
Chris
Chris:
Use two scripts -- it will work.
The first to display a page, like so:
http://xn--ovg.com/a/wait.php
And then have that script run your second script like so:
ob_clean();
include('second.php');
exit(0);
hth's
tedd
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
--- End Message ---