php-general Digest 3 Oct 2004 23:37:40 -0000 Issue 3032

Topics (messages 198533 through 198561):

Re: set multiple variables
        198533 by: argesson
        198534 by: Graham Cossey
        198535 by: dirk
        198552 by: Matthew Fonda
        198553 by: argesson
        198554 by: Daniel Schierbeck

Re: PHP (anti) crash policy?
        198536 by: Manuel Lemos
        198537 by: Olaf van der Spek
        198541 by: Manuel Lemos
        198543 by: Olaf van der Spek
        198544 by: Manuel Lemos
        198545 by: Olaf van der Spek
        198546 by: Manuel Lemos

Re: How to install php5 on Fedora Core2
        198538 by: Teng Wang
        198539 by: Robert Cummings
        198540 by: Teng Wang
        198542 by: Robert Cummings
        198548 by: Matthew Fonda
        198551 by: Matthew Fonda
        198556 by: Teng Wang
        198561 by: Marek Kilimajer

Re: Using PHP4 or PHP5
        198547 by: Matthew Fonda

Re: Regular Expression - highlighting
        198549 by: Michael Sims

Re: A problem of installation
        198550 by: Matthew Fonda

HOWTO: Install PHP on Fedora Core / Redhat
        198555 by: Matthew Fonda

Why my browser always chooses UTF-8 charset?
        198557 by: Teng Wang
        198558 by: Robert Cummings
        198559 by: Teng Wang
        198560 by: Thomas Goyne

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 --- Daniel Schierbeck wrote:
Argesson wrote:

try this:
if ($REMOTE_ADDR == "212.3.54.65" && $REMOTE_ADDR == "212.3.54.66")

Joe Szilagyi wrote:

Hi, I have this working:


if ($REMOTE_ADDR == "212.3.54.65") { header("Location: http://www.google.com/search?&q=huzzah";); Redirect browser exit; }


But I want to specify multiple IPs. What's the best recommended way for doing that?


thanks Joe


Make that:
if ($REMOTE_ADDR == "212.3.54.65" || $REMOTE_ADDR == "212.3.54.66")

isn't the || same as && ? Or I missed something?

--- End Message ---
--- Begin Message ---
||= OR
&& = AND

-----Original Message-----
From: argesson [mailto:[EMAIL PROTECTED]
Sent: 03 October 2004 11:30
To: [EMAIL PROTECTED]
Subject: [PHP] Re: set multiple variables


Daniel Schierbeck wrote:
> Argesson wrote:
> 
>> try this:
>> if ($REMOTE_ADDR == "212.3.54.65" && $REMOTE_ADDR == "212.3.54.66")
>>
>> Joe Szilagyi wrote:
>>
>>> Hi, I have this working:
>>>
>>>
>>> if ($REMOTE_ADDR == "212.3.54.65")  {
>>>         header("Location: http://www.google.com/search?&q=huzzah";);
>>> Redirect browser
>>>         exit;
>>>         }
>>>
>>>
>>> But I want to specify multiple IPs. What's the best recommended way for
>>> doing that?
>>>
>>>
>>> thanks
>>> Joe
> 
> 
> Make that:
> if ($REMOTE_ADDR == "212.3.54.65" || $REMOTE_ADDR == "212.3.54.66")

isn't the || same as && ? Or I missed something?

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

--- End Message ---
--- Begin Message ---
$REMOTE_ADDR == "212.3.54.65" || $REMOTE_ADDR == "212.3.54.66" is correct


On Sun, 3 Oct 2004 12:39:11 +0100, Graham Cossey <[EMAIL PROTECTED]> wrote:
> 
> ||= OR
> && = AND
> 
> 
> 
> -----Original Message-----
> From: argesson [mailto:[EMAIL PROTECTED]
> Sent: 03 October 2004 11:30
> To: [EMAIL PROTECTED]
> Subject: [PHP] Re: set multiple variables
> 
> Daniel Schierbeck wrote:
> > Argesson wrote:
> >
> >> try this:
> >> if ($REMOTE_ADDR == "212.3.54.65" && $REMOTE_ADDR == "212.3.54.66")
> >>
> >> Joe Szilagyi wrote:
> >>
> >>> Hi, I have this working:
> >>>
> >>>
> >>> if ($REMOTE_ADDR == "212.3.54.65")  {
> >>>         header("Location: http://www.google.com/search?&q=huzzah";);
> >>> Redirect browser
> >>>         exit;
> >>>         }
> >>>
> >>>
> >>> But I want to specify multiple IPs. What's the best recommended way for
> >>> doing that?
> >>>
> >>>
> >>> thanks
> >>> Joe
> >
> >
> > Make that:
> > if ($REMOTE_ADDR == "212.3.54.65" || $REMOTE_ADDR == "212.3.54.66")
> 
> isn't the || same as && ? Or I missed something?
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 



-- 
Try http://einx.dyndns.org

--- End Message ---
--- Begin Message ---
On Sun, 2004-10-03 at 04:39, Graham Cossey wrote:
> isn't the || same as && ? Or I missed something?

No, || is OR, and && is AND
Check out http://www.php.net/manual/en/language.operators.logical.php

-- 
Regards,
Matthew Fonda

--- End Message ---
--- Begin Message --- Matthew Fonda wrote:
On Sun, 2004-10-03 at 04:39, Graham Cossey wrote:

isn't the || same as && ? Or I missed something?


No, || is OR, and && is AND
Check out http://www.php.net/manual/en/language.operators.logical.php

OK, sorry, my mistake. And thanks.
newbie

--- End Message ---
--- Begin Message --- Matthew Fonda wrote:
On Sun, 2004-10-03 at 04:39, Graham Cossey wrote:

isn't the || same as && ? Or I missed something?


No, || is OR, and && is AND
Check out http://www.php.net/manual/en/language.operators.logical.php

Weeeeeeeell - sort of. The precedence level can be tricky, sometimes "||" doesn't act like "or" (and the same with "&&" and "and").
--- End Message ---
--- Begin Message ---
Hello,

On 10/02/2004 06:01 PM, Olaf Van Der Spek wrote:
AFAIK PHP runs safely in multi-threaded servers. What you can't expect is that PHP handles abnormal situations caused by flaws in the external libraries that PHP links with.


When I link with the same library in a C app, this 'abnormal situation' just results in a normal return from 'gzinflate' with an error value.
So why is it a flaw in code from zlib?

That is not the problem. The problem is that zlib does not seem to be able to detect and deal with corrupted streams. That leads to requesting absurd amounts of memory that the PHP memory allocator has no way to distinguish whether it is an intentional memory space request or something case by an abnormal situation.


It is not up to PHP memory allocator to guess what is going on. So it handles like an normal memory allocation, gracefully exits like in any other operations that request space above the configured limits.

If zlib was ready to detect corruption it would never request an absurd amount of memory. I do not think it would be wise to change the PHP memory allocator behavior just to deal with zlib inability to detect corruption before asking for exceedingly large memory blocks.


Maybe you should try this script on a multi-threaded webserver. Is this also caused by flaws in external libraries?

<?php
    function f()
    {
        f();
    }

    f();
?>

The flaw is in your code as nobody should be writing infinite recursion programs.


If you run a similar program in C it will crash exceeding the acceptable calling stack space. I don't know if you do that in PHP that could be avoided as I don't know if PHP can determine whether the stack space was exceeded.

Anyway, the only way to deal with this situation is to let the current process exit as there is no way to recover from this situation that is evidently a bug of the script, not of PHP.


--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html

--- End Message ---
--- Begin Message ---
Manuel Lemos wrote:

Hello,

On 10/02/2004 06:01 PM, Olaf Van Der Spek wrote:

AFAIK PHP runs safely in multi-threaded servers. What you can't expect is that PHP handles abnormal situations caused by flaws in the external libraries that PHP links with.



When I link with the same library in a C app, this 'abnormal situation' just results in a normal return from 'gzinflate' with an error value.
So why is it a flaw in code from zlib?


That is not the problem. The problem is that zlib does not seem to be able to detect and deal with corrupted streams. That leads to requesting absurd amounts of memory that the PHP memory allocator has no way to distinguish whether it is an intentional memory space request or something case by an abnormal situation.

It is not up to PHP memory allocator to guess what is going on. So it

It indeed isn't. However, it should be possible for the zlib code to say to the allocator: "Try to allocate this, if that fails, return an error to me instead of aborting the script".


handles like an normal memory allocation, gracefully exits like in any other operations that request space above the configured limits.

Gracefully, as in aborting/resetting the TCP/HTTP connection?

If zlib was ready to detect corruption it would never request an absurd amount of memory. I do not think it would be wise to change the PHP memory allocator behavior just to deal with zlib inability to detect corruption before asking for exceedingly large memory blocks.

I disagree, see above.

The flaw is in your code as nobody should be writing infinite recursion programs.

No, there is A flaw in my code. That doesn't mean it's THE flaw.


If you run a similar program in C it will crash exceeding the acceptable calling stack space. I don't know if you do that in PHP that could be avoided as I don't know if PHP can determine whether the stack space was exceeded.


Anyway, the only way to deal with this situation is to let the current

How can you claim that's the only way if you don't know whether it's avoidable by PHP?


process exit as there is no way to recover from this situation that is evidently a bug of the script, not of PHP.



--- End Message ---
--- Begin Message ---
Hello,

On 10/03/2004 10:18 AM, Olaf Van Der Spek wrote:
That is not the problem. The problem is that zlib does not seem to be able to detect and deal with corrupted streams. That leads to requesting absurd amounts of memory that the PHP memory allocator has no way to distinguish whether it is an intentional memory space request or something case by an abnormal situation.

It is not up to PHP memory allocator to guess what is going on. So it


It indeed isn't. However, it should be possible for the zlib code to say to the allocator: "Try to allocate this, if that fails, return an error to me instead of aborting the script".

That would be breaking the normal behavior of PHP memory handling failures. All memory handling failures are currently not recoverable.


I think that making all failed memory allocations recoverable is not viable because more PHP C code that makes memory allocations assumes it only returns if it succeeds. Trying to change that everywhere memory is allocated is and monster job that I doubt that any PHP core developer will agree on doing.


handles like an normal memory allocation, gracefully exits like in any other operations that request space above the configured limits.


Gracefully, as in aborting/resetting the TCP/HTTP connection?

Gracefully means not crashing with a core dump.


The flaw is in your code as nobody should be writing infinite recursion programs.


No, there is A flaw in my code. That doesn't mean it's THE flaw.

It is nobody else's fault if you write buggy code. Although it is desirabe to have means to detect program bugs during testing phases, such means may impose performance penalties that may not be reasonable to have in PHP versions running in production.


I know there are debugging extensions that can help detecting deep recursion situations. That does not mean that it is good idea to run such extensions on production environments on which you need to have all the performance that you can get.


If you run a similar program in C it will crash exceeding the acceptable calling stack space. I don't know if you do that in PHP that could be avoided as I don't know if PHP can determine whether the stack space was exceeded.

Anyway, the only way to deal with this situation is to let the current


How can you claim that's the only way if you don't know whether it's avoidable by PHP?

I do not think that there is a way for PHP to automatically fix a bug in your code .



--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html

--- End Message ---
--- Begin Message --- Manuel Lemos wrote:
Hello,
I think that making all failed memory allocations recoverable is not viable because more PHP C code that makes memory allocations assumes it only returns if it succeeds. Trying to change that everywhere memory is allocated is and monster job that I doubt that any PHP core developer will agree on doing.

You could just create a new function for that: alloc_no_exception
There's no need to change every call, you'd only need to change the calls that can take a NULL result.

--- End Message ---
--- Begin Message ---
Hello,

On 10/03/2004 12:27 PM, Olaf Van Der Spek wrote:
I think that making all failed memory allocations recoverable is not viable because more PHP C code that makes memory allocations assumes it only returns if it succeeds. Trying to change that everywhere memory is allocated is and monster job that I doubt that any PHP core developer will agree on doing.


You could just create a new function for that: alloc_no_exception
There's no need to change every call, you'd only need to change the calls that can take a NULL result.

I find it hard to justify such function, but nothing stops you to propose a patch to PHP developers and see if they find acceptable.


--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html

--- End Message ---
--- Begin Message --- Manuel Lemos wrote:
Hello,

On 10/03/2004 12:27 PM, Olaf Van Der Spek wrote:

I think that making all failed memory allocations recoverable is not viable because more PHP C code that makes memory allocations assumes it only returns if it succeeds. Trying to change that everywhere memory is allocated is and monster job that I doubt that any PHP core developer will agree on doing.



You could just create a new function for that: alloc_no_exception
There's no need to change every call, you'd only need to change the calls that can take a NULL result.


I find it hard to justify such function

Why?
I think a large number of data handling functions would benefit from such a function.
And it'd make PHP more robust.

--- End Message ---
--- Begin Message ---
Hello,

On 10/03/2004 01:46 PM, Olaf Van Der Spek wrote:
I think that making all failed memory allocations recoverable is not viable because more PHP C code that makes memory allocations assumes it only returns if it succeeds. Trying to change that everywhere memory is allocated is and monster job that I doubt that any PHP core developer will agree on doing.

You could just create a new function for that: alloc_no_exception
There's no need to change every call, you'd only need to change the calls that can take a NULL result.

I find it hard to justify such function


Why?
I think a large number of data handling functions would benefit from such a function.
And it'd make PHP more robust.

Because it is an hack to work around the lack of support for detection of corrupted data in zlib.


In the end you will be able to handle the failure of zlib but you will not be able to tell whether it failed because the file was too large to decompress or because it failed due to corrupted data.

I think it would be better that zlib would be able to detect corrupted data so you could eventually tell the user that the file is corrupted instead of misleading with a message saying there was not enough memory.


--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html

--- End Message ---
--- Begin Message ---
Surely apache is running.
And I checked httpd.conf. There is no "LoadModule php4.x.x
...". Anyother settings should be removed?

The first time I installed php5.0.0, I forgot to add
--with-apxs2=/usr/sbin/apxs. It works but the version is 4.3.8 as phpinfo() shows. 
When I added this option, the php
didn't work anymore. But the apache works fine. The browser
can read .html files. 

Anyone can help me?



Teng Wang wrote:
> I have some difficulties when installing php5.0.2 on FC2
> 
> I used the default settings:
> ./configure --with-apxs2=/usr/sbin/apxs
> build
> build install
> 
> The installation is complete but when I test phpinfo() in a .php file from browser, 
> the browser says "Can't find the
> server"

Can't find the SERVER. Make sure apache is running.

> 
> My FC2 is fully installed and I don't know why the php
> module doesn't work.
> 
> I doubt if there is some manual settings are need during the configuration/make/make 
> install, or there is some setting
> after the installation such as change the default httpd.conf or /etc/php.ini

If you had php4 installed, remove php4 stuff from httpd.conf

> 
> I type php -v, the version is fine, php -i is also correct.
> But I can't make it work through http.
> 
> Thanks in advance for any kindly help!

--- End Message ---
--- Begin Message ---
On Sun, 2004-10-03 at 09:43, Teng Wang wrote:
> Surely apache is running.
> And I checked httpd.conf. There is no "LoadModule php4.x.x
> ...". Anyother settings should be removed?
> 
> The first time I installed php5.0.0, I forgot to add
> --with-apxs2=/usr/sbin/apxs. It works but the version is 4.3.8 as phpinfo() shows. 
> When I added this option, the php
> didn't work anymore. But the apache works fine. The browser
> can read .html files. 

Redhat splits up the http config file into sub configurations for each
module. Check the config file located at:

    /etc/httpd/conf.d/php.conf

Cheers,
Rob.
-- 
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for       |
| creating re-usable components quickly and easily.          |
`------------------------------------------------------------'

--- End Message ---
--- Begin Message ---
Thanks a lot. It works!

But a new problem is: default setting loses all extensions.
If I wanna install all extension in the package, how to
configure the installation and reinstall?

Thanks a lot!

--- End Message ---
--- Begin Message ---
On Sun, 2004-10-03 at 10:21, Teng Wang wrote:
> Thanks a lot. It works!
> 
> But a new problem is: default setting loses all extensions.
> If I wanna install all extension in the package, how to
> configure the installation and reinstall?

There are two ways... you can either compile in the extensions using the
appropriate ./configure settings (see "./configure --help" for all
available settings), or you can try and find prebuilt extensions and
place them in the appropriate extensions dir (for php4 /usr/lib/php4
under redhat, you may want to create a separate one for php5), then you
will need to add a .ini file for the module at /etc/php.d/ which loads
the prebuilt extension. There are often RPMs that do all this for you,
but I don't know that any exist for php5 yet.

Cheers,
Rob.
-- 
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for       |
| creating re-usable components quickly and easily.          |
`------------------------------------------------------------'

--- End Message ---
--- Begin Message ---
Howdy,

Redhat is notorious for leaving out things, such as apxs. To get php
working, you will most likely have to download apache, build it, and
install it. Make sure you configure apache with --enable-so. After
apache builds, do make install.

And then, when configuring php, do
./configure --with-apxs2=/usr/local/apache2/bin/apxs

That should work just fine. You can still have your old apache installed
at the same time, just don't use it. Copy the config files from the old
apache, and do /etc/init.d/httpd stop, then startup the other apache
(probably /usr/local/apache2/bin/httpd), and php should be working
perfectly

-- 
Regards,
Matthew Fonda

On Sun, 2004-10-03 at 07:03, Robert Cummings wrote:
> On Sun, 2004-10-03 at 09:43, Teng Wang wrote:
> > Surely apache is running.
> > And I checked httpd.conf. There is no "LoadModule php4.x.x
> > ...". Anyother settings should be removed?
> > 
> > The first time I installed php5.0.0, I forgot to add
> > --with-apxs2=/usr/sbin/apxs. It works but the version is 4.3.8 as phpinfo() shows. 
> > When I added this option, the php
> > didn't work anymore. But the apache works fine. The browser
> > can read .html files. 
> 
> Redhat splits up the http config file into sub configurations for each
> module. Check the config file located at:
> 
>     /etc/httpd/conf.d/php.conf
> 
> Cheers,
> Rob.
> -- 
> .------------------------------------------------------------.
> | InterJinn Application Framework - http://www.interjinn.com |
> :------------------------------------------------------------:
> | An application and templating framework for PHP. Boasting  |
> | a powerful, scalable system for accessing system services  |
> | such as forms, properties, sessions, and caches. InterJinn |
> | also provides an extremely flexible architecture for       |
> | creating re-usable components quickly and easily.          |
> `------------------------------------------------------------'

--- End Message ---
--- Begin Message ---
Howdy,
When you configure, you need to make sure you have --with-ext= or
--enable-ext for all the extensions you want to use. If you want all the
same extensions from your previous install, you could copy and paste
them out of the configuration command of your old phpinfo() page. If you
try and use mysql, you may get an error about header files being
missing, you need to copy the mysql .h files into the include directory
for mysql.

Also, if you dont want to re compile the entire thing, you can compile
extensions separately, and load them with either dl() in a script, or
just add them to php.ini
-- 
Regards,
Matthew Fonda

On Sun, 2004-10-03 at 07:21, Teng Wang wrote:
> Thanks a lot. It works!
> 
> But a new problem is: default setting loses all extensions.
> If I wanna install all extension in the package, how to
> configure the installation and reinstall?
> 
> Thanks a lot!

--- End Message ---
--- Begin Message ---
Finally I succeeded on the installation. Just manually add
all --with-EXTENSIONS and remove all unvailable ones. The
procedure is too completed. I hope there should be some
scripts which automatically check the availability of each
extension and generate the configuration file.

Anyway, thanks a lot to all warm-hearted experts!

Eruisi

--- End Message ---
--- Begin Message --- Teng Wang wrote:
Finally I succeeded on the installation. Just manually add
all --with-EXTENSIONS and remove all unvailable ones. The
procedure is too completed. I hope there should be some
scripts which automatically check the availability of each
extension and generate the configuration file.

Anyway, thanks a lot to all warm-hearted experts!

Eruisi


You mean something like --enable-all. But then you would not know which extensions are installed and which are not.

--- End Message ---
--- Begin Message ---
I would say PHP5, for sure. PHP5 is much better in nearly every way, and
more and more people are using it every day. Also, for the most part,
PHP4 is backwards compatible with PHP5, so it shouldn't be too much of a
problem. I would absolutely recommend upgrading to PHP5.

-- 
Regards,
Matthew Fonda

On Sat, 2004-10-02 at 12:19, Michael Lauzon wrote:
> As I mentioned earlier, I am putting a team together to create a
> web-based RPG, different from the one I am currently playing.  Would
> it be better to use PHP4 with it's strong developer base, or the new
> PHP5 which is more object oriented an in my opinion would be easier to
> keep the game up to date?
> 
> -- 
> Michael Lauzon
> P.S. This is the game I am playing, but I have ideas that I think can
> be done better than what was done for this game -- but everyone always
> says that!:
> 
> http://phantasyrpg.com/main.php?view=9898

--- End Message ---
--- Begin Message ---
Aidan Lister wrote:
> Hello list,
>
> I'm pretty terrible with regular expressions, I was wondering if
> someone would be able to help me with this
> http://paste.phpfi.com/31964
>
> The problem is detailed in the above link. Basically I need to match
> the contents of any HTML tag, except a link. I'm pretty sure a
> lookbehind set is needed in the center (%s) bit.
>
> Any suggestions would be appreciated, but it's not quite as simple as
> it sounds - if possible please make sure you run the above script and
> see if it "PASSED".

So basically, you want to put a link around "foo", only if it doesn't
already have one, right?

The problem with look-behind assertions is that they have to be fixed-width.
If you're certain of what kind of data you're going to be dealing with then
this may be sufficient.  For example, I came up with a regex that will PASS
your script but I doubt seriously that it'll be very useful to you as it
would be easy to break it by coming up with various test cases.  For your
single test case, however, this works:

/(?<!<a href="foo">)(?<!<a href=")(foo)/

The problem is that HTML tags can be split across lines...they have have any
variable amount of whitespace within the tag...they can have other
attributes (class, id, onClick), etc.  Since look behind assertions have to
be fixed width it'd be impossible (IMHO) to come up with a single regex that
would match all cases, unless the input data was uniform.  For example,
stuff like

<a   href = "foo" ID="id1" class="redlink"
onClick="javascript:someFunction();">foo</a>

and its infinite variants could not be trapped for with a single regex since
you cannot have an infinite number of fixed width look-behind assertions.
If quantifying modifiers such as '*', '+', and '?' were allowed in
look-behind assertions it would be possible, but they aren't (see "man
perlre").

If your data is coming from unknown sources you'll probably have to use a
full fledged HTML parser to pull out text that isn't already part of an <a>
tag.  I know there are several of these available for perl and I'm sure
there are for PHP too but I'm unaware of them.

Sorry if this isn't terribly helpful.  Maybe I'm overlooking something and
someone else will point out a simple way to accomplish what you're trying to
do...

--- End Message ---
--- Begin Message ---
Howdy,

Redhat is notorious for leaving out things, such as apxs. To get php
working, you will most likely have to download apache, build it, and
install it. Make sure you configure apache with --enable-so. After
apache builds, do make install.

And then, when configuring php, do
./configure --with-apxs2=/usr/local/apache2/bin/apxs

That should work just fine. You can still have your old apache installed
at the same time, just don't use it. Copy the config files from the old
apache, and do /etc/init.d/httpd stop, then startup the other apache
(probably /usr/local/apache2/bin/httpd), and php should be working
perfectly

-- 
Regards,
Matthew Fonda

On Sat, 2004-10-02 at 21:27, Robert Cummings wrote:
> On Sun, 2004-10-03 at 00:05, Teng Wang wrote:
> > I met with a problem when installing php5.0.0 on my Federo Core 2.0 system.
> > 
> > I use the default settings:
> > ./configure
> > make
> > make install
> > 
> > Everything is ok, but when I test my phpinfo(),it always shows the
> > 4.3.8 version. Yet, when I type the following command
> > php -v
> > to show the version of php, it's 5.0.0
> > 
> > What's the problem? Any kindly help would be appreciated.
> 
> Where are you loading phpinfo()? If it is in browser then there's a good
> chance you've only built the cgi/cli version and not the module. The
> module version needs the --with-apxs flage enabled.
> 
> Cheers,
> Rob.
> -- 
> .------------------------------------------------------------.
> | InterJinn Application Framework - http://www.interjinn.com |
> :------------------------------------------------------------:
> | An application and templating framework for PHP. Boasting  |
> | a powerful, scalable system for accessing system services  |
> | such as forms, properties, sessions, and caches. InterJinn |
> | also provides an extremely flexible architecture for       |
> | creating re-usable components quickly and easily.          |
> `------------------------------------------------------------'

--- End Message ---
--- Begin Message ---
Howdy,

I noticed that quite a few people were having a hard time installing PHP
on Fedora Core or Redhat, so I put together a little tutorial explaining
how to do it. Hope it helps :D
http://mfonda.dotgeek.org/fcrh.php

-- 
Regards,
Matthew Fonda

--- End Message ---
--- Begin Message ---
Although I have included charset (GB2312) information in my
html/php files. 

<meta http-equiv=Content-Type content="text/html;
charset=gb2312">

And my browser has "Auto-select" settings.
How to make the browser select charset correctly,


                            eruisi
                            10/03/2004
                            17:53:14

--- End Message ---
--- Begin Message ---
Look for this in your php.ini:

    default_charset

Cheers,
Rob.

On Sun, 2004-10-03 at 17:56, Teng Wang wrote:
> Although I have included charset (GB2312) information in my
> html/php files. 
> 
> <meta http-equiv=Content-Type content="text/html;
> charset=gb2312">
> 
> And my browser has "Auto-select" settings.
> How to make the browser select charset correctly,
> 
> 
>                             eruisi
>                             10/03/2004
>                             17:53:14
-- 
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for       |
| creating re-usable components quickly and easily.          |
`------------------------------------------------------------'

--- End Message ---
--- Begin Message ---
Hi:

But I still want the default language to be English, I can
set a page to be Chinese if I wanna to do so. Is that
possible? Why doesn't the meta information work?


                            Teng Wang
                            2004/10/03
                                                        18:03:54
>At Sun, 03 Oct 2004 18:04:10 -0400 ,You wrote:
> Look for this in your php.ini:
> 
>     default_charset
> 
> Cheers,
> Rob.
> 
> On Sun, 2004-10-03 at 17:56, Teng Wang wrote:
> > Although I have included charset (GB2312) information in my
> > html/php files. 
> > 
> > <meta http-equiv=Content-Type content="text/html;
> > charset=gb2312">
> > 
> > And my browser has "Auto-select" settings.
> > How to make the browser select charset correctly,
> > 
> > 
> >                             eruisi
> >                             10/03/2004
> >                             17:53:14
> -- 
> .------------------------------------------------------------.
> | InterJinn Application Framework - http://www.interjinn.com |
> :------------------------------------------------------------:
> | An application and templating framework for PHP. Boasting  |
> | a powerful, scalable system for accessing system services  |
> | such as forms, properties, sessions, and caches. InterJinn |
> | also provides an extremely flexible architecture for       |
> | creating re-usable components quickly and easily.          |
> `------------------------------------------------------------'




*****************************************
* Teng Wang
*
* Univ. of Mass. Amherst
* ECE Department
* USA
*
* (Lab)1-413-545-0923
* (E-mail)[EMAIL PROTECTED]
*****************************************
 

--- End Message ---
--- Begin Message ---
On Sun, 03 Oct 2004 18:05:32 -0400, Teng Wang <[EMAIL PROTECTED]> wrote:

Hi:

But I still want the default language to be English, I can
set a page to be Chinese if I wanna to do so. Is that
possible? Why doesn't the meta information work?


Setting the charset in the html doesn't work very well for the simple reason that the parser has to decide on a charset before it can even read the tag. Note that UTF-8 will allow you to freely mix English and Chinese without problems.



--

Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
--- End Message ---

Reply via email to