[PHP] Page not found problem

2002-07-10 Thread Chen

I use php3 with IIS 5.0. When user typed a no existing .html or php3
page, they will get a "No input file specified." page. How can I point
this to a  HTTP Error 400 page? Anything can be set up in the php.ini
file or in IIS configuration?

Thanks for any help!!


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




Re: [PHP] Page not found problem

2002-07-10 Thread Chen

Chris,

Thank you for the response. I think this is the php setting. If  the user
enter a page name 12345.pdf and there is no such page, the browse will show
the page cannot be found and the HTTP 404 error. But if user enter
12345.php3 or 12345.html(IIS mapping these two kind of files to php.exe),
the HTTP 404 error won't show up, only display "No input file specified."
message.

Chris Hewitt wrote:

> Chen,
>
> If the webserver cannot file a file then this is a webserver problem not
> php. You need to look at your IIS configuration/documentation. Sorry I
> can't help further, but I don't use IIS.
>
> HTH
> Chris
>
> Chen wrote:
>
> >I use php3 with IIS 5.0. When user typed a no existing .html or php3
> >page, they will get a "No input file specified." page. How can I point
> >this to a  HTTP Error 400 page? Anything can be set up in the php.ini
> >file or in IIS configuration?
> >
> >Thanks for any help!!
> >
> >


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




[PHP] Re: access denied

2002-10-04 Thread Chen Shuang

try CHMODing your files and your directory to 777, since i believe you are
using a Linux Server.

"Simon Angell" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> The PHP script im using works on my computers server, but when after
> uploading to my web server i get this...
> Warning: fopen("wtest.txt", "wb+") - Permission denied in
> /home/canberra/public_html/bomonster/canberra.php on line 6
>
> Dunno why either, the directory is not protected, can anyne help me with
> this?
> one?
> The particular code in question...
> //Writing of local file
>
>  $rContents = implode( "\r\n", file(
> 'ftp://ftp.bom.gov.au/anon/gen/fwo/IDN10035.txt' ) );
>
> if( ($fp = fopen( 'wtest.txt', 'wb+' )) !== false )
> {
> fputs( $fp, $rContents );
> fclose( $fp );
> }
> --
> Cheers
> -
> Simon Angell
> Canberra ACT
> www.canberra-wx.com
> -
> Member of:
> Australian Severe Weather Association.
> www.severeweather.asn.au
> -
> This email is virus free.
> Scanned before leaving my mailbox
> using Norton Antivirus 2002 for Win2k
> Scanned with the latest definition File.
>
>



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




Re: [PHP] flushing data as it's being generated

2002-11-12 Thread arthur chen
Thanks, that did the trick!
Should've read the documentation on flush( ). =]

- Original Message -
From: "Jason Wong" <[EMAIL PROTECTED]>
Newsgroups: php.general
To: <[EMAIL PROTECTED]>
Sent: Tuesday, November 12, 2002 6:18 AM
Subject: Re: [PHP] flushing data as it's being generated


> On Tuesday 12 November 2002 22:10, arch wrote:
> > Hi..
> >
> > I'm using php to pull data from a mysql table and output it to the
browser.
> > Pretty basic stuff. The problem is that the output is very slow, seen
from
> > the browser end, because the html output isn't displayed at all until
all
> > the data has been retrieved. Actually it's just the  part of the
> > html that delays. Every  row corresponds to a row from the mysql
> > table, and many rows are being displayed.
> >
> > However, I've seen php generated pages that display the data even as
it's
> > being pulled from the database. So the delay time isn't as hard to
endure.
> >
> > I'm wondering if anyone knows what the trick is to output a large volume
of
> > html data from php in the second way. I've tried adding flush to the end
of
> > every iteration of the loop that's looping through the rows of data, but
it
> > doesn't help.
>
> Most browsers only start rendering tables when they see the  tag.
One
> solution is to split your single table into multiple tables each with, say
10
> rows. However one drawback using this method is that if you do not specify
> the column widths then they can vary from table to table and it may look a
> bit odd.
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
>
> /*
> Objects are lost only because people look where they are not rather than
> where they are.
> */
>


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




[PHP] AUTH_PW & External Authentication

2001-01-26 Thread Chen Shiyuan

Hello everyone!

I am currently using Apache-1.3.14 with php-4.0.4pl1 compiled statically 
into it and running on RedHat Linux 6.2 . Apache is configured to do 
authentication for certain URLs via a auth_ldap module which is 
dynamically loaded when Apache starts.

I noticed that when I access the protected URL, PHP_AUTH_PW will give me 
the password for the user who is currently logged to the protected site. 
If I recall correctly, earlier versions of PHP4 and PHP3 didn't have 
this "feature" .

This "feature" creates a problem when the protected URL is shared by 
many parties with each party providing it's own services under the 
protected URL as any party would be able to "steal" the 
username/password without the end user knowing. The username/password is 
used to control who has access to the protected URL and the parties are 
not required to make use of the password.

Is there anyway to disable this "feature" or is the disclosure of the 
password a bug?

Many thanks for any advice!

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] How to let PHP cgi find oracle TNS?

2001-05-10 Thread Jude Chen



I use PHP (version 4.0.3pl1) as a cgi on my IIS web server with NT4.0. But 
I find when I try to connect a distant Oracle database, PHP can not find the 
correct TNS name, quoted as followings:
 
Warning: Unable to connect to ORACLE (ORA-12154: TNS:could 
not resolve service name) in E:\website\yktest\web\includes\db\dbenv.php 
on line 4
But I have the correct TNS, through which I can connect to Oracle 
using SQL*PLUS, configured on the machine, using SQL*NET configuration 
tool.
 
I don't know why, can anyone help me?


[PHP] How to let PHP cgi find oracle TNS?

2001-05-14 Thread Jude Chen



 
I use PHP (version 4.0.3pl1) 
as a cgi on my IIS web server with NT4.0. But I find when I try to connect a 
distant Oracle database, PHP can not find the correct TNS name, quoted as 
followings:
 
Warning: Unable to connect to ORACLE (ORA-12154: TNS:could 
not resolve service name) in E:\website\yktest\web\includes\db\dbenv.php 
on line 4
 
But I have the correct TNS, through which I can connect to Oracle 
using SQL*PLUS, configured on the machine, using SQL*NET configuration 
tool.
 
I don't know why, can anyone help me?
 
Jude Chen


Re: [PHP] why isn't this working? (many questions inside)

2002-01-28 Thread Robin Chen

Maybe your script timed out before it could finish.  Try
set_time_limit(0)

Another possibility is that your browser gave up.  You may need 4GB of
disk cache because browsers usually save all files in cache before
copying them to the place you designate.

Robin

Wei Weng wrote:
> 
> First, I am running (currently) php 4.0.6 under Redhat 7.2 with kernel
> 2.4.10
> 
> I know you can do the following:
> 
>  
> header("Content-type: application/force-download");
> header("Content-disposition: attachment; filename=blah.txt");
> readfile("blah.txt");
> 
> ?>
> 
> to force the user to download a file.
> 
> However, this wouldn't work if blah.txt is larger than 2G on my machine
> with php 4.0.6 for Redhat 7.2, because all the file I/O operations are
> done in 32 bits functions.
> 
> So here are two solutions i though about:
> 
> 1) instead of readfile("blah.txt"), do a passthru("cat blah.txt"). Since
> the basic idea of forcing a download is to pipe the file content to the
> standard output (which is the browser in this case), i don't understand
> why passthru("cat blah.txt") wouldn't do the trick. In fact, I can only
> download about 88Mbs of the whole 4G file I planned to download.
> 
> 2) recompile the php package with -D_FILE_OFFSET_BITS=64 enabled. However,
> with the ./configure; make; make install, i can't seem to figure out where
> to stick the option in. (prefer doing it in one of the configure arguments
> if possible)
> 
> Forgive me if I posted this to the wrong mailing list, I had been losing
> hairs over these puzzled questions.
> 
> TIA.
> 
> --
> Wei Weng
> Network Software Engineer
> KenCast Inc.
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Database Development Price Inquiry?

2002-03-21 Thread Robin Chen



"[-^-!-%-" wrote:

> Hello everyone,
>
> I'm in the process of revising my db development prices, and was wondering
> what the best practices were. I want to keep my prices low, but I often
> feel like I'm not charging close to what I should be charging.
>
> 1) What is the going rate for Database Development (MySQL+PHP
> or any other combo)?
>
> 2) What (or how) do you charge for MySQL+PHP database applications?
> 3) What do you factor into your pricing?
>
> We currently package our prices by the project. Example, we
> would charge one flat fee for an online database application.
> This would include everything from start to finish. Sometimes
> this works out, but other times it gets painful and tedious. I often feel
> like I'm not charging as much as I should be.
>
> 4) What is the best practice for db development pricing?
> Flat fee or hourly based? Do you charge based on the number of hours spent
> (anticipated) or by the project complexity and/or size?
>
> 5) Do you charge in stages or upon completion? For example, do you charge
> after the planning phase, development phase, etc. Or, after the project
> is complete?
>
> I'm especially interested in hearing from the West Coast (USA) developers.
> Any feedback would be greatly appreciated.
>
> Thanks.
>
> -john
>
> --
> 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




Re: [PHP] Database Development Price Inquiry?

2002-03-21 Thread Robin Chen

We calculate the charge by $75-$150 per hour depending on complexity of the
project, then quote customer the final price.  On small projects, < $5000, its
usually half before project, and half after project.  For project > $5000,
it's usually 30% up front, 30% when we have major features completed, 30% when
delivered, last 10% when finalized.  On even large projects $15k+, we usually
go by phases.

Robin

"[-^-!-%-" wrote:

> Hello everyone,
>
> I'm in the process of revising my db development prices, and was wondering
> what the best practices were. I want to keep my prices low, but I often
> feel like I'm not charging close to what I should be charging.
>
> 1) What is the going rate for Database Development (MySQL+PHP
> or any other combo)?
>
> 2) What (or how) do you charge for MySQL+PHP database applications?
> 3) What do you factor into your pricing?
>
> We currently package our prices by the project. Example, we
> would charge one flat fee for an online database application.
> This would include everything from start to finish. Sometimes
> this works out, but other times it gets painful and tedious. I often feel
> like I'm not charging as much as I should be.
>
> 4) What is the best practice for db development pricing?
> Flat fee or hourly based? Do you charge based on the number of hours spent
> (anticipated) or by the project complexity and/or size?
>
> 5) Do you charge in stages or upon completion? For example, do you charge
> after the planning phase, development phase, etc. Or, after the project
> is complete?
>
> I'm especially interested in hearing from the West Coast (USA) developers.
> Any feedback would be greatly appreciated.
>
> Thanks.
>
> -john
>
> --
> 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




[PHP] = 0 and = "0"

2001-10-25 Thread Robin Chen

why does



work properly but not the following



Thanks,

Robin

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] = 0 and = "0"

2001-10-25 Thread Robin Chen

Thank you, that was it.  I needed to test the variable against both an
integer and a string, so I ended up using (string) when I need to
compare a string.  Rest of the time, it's an integer.

Robin

Rasmus Lerdorf wrote:
> 
> > If you set $qty=0; then $qty has no value.
> 
> Of course it has a value.  The value is 0.
> Quite distinct from not having a value, or in proper terms, not being set.
> Try this:
> 
> var_dump($qty);
> $qty = 0;
> var_dump($qty);
> 
> Well, I will save you the trouble, it outputs:
> 
> NULL
> int(0)
> 
> > Type casting is irrelevant in php.
> 
> No they aren't.  Try this:
> 
> $qty = 0;
> if($qty=="test") echo "foo";
> if((string)$qty=="test") echo "bar";
> 
> This will only output "foo".  Not "bar".  You could also use the ===
> operator to force PHP to check not only the value but also the type.
> 
> See http://www.php.net/manual/en/language.operators.comparison.php
> 
> -Rasmus
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] = 0 and = "0"

2001-10-25 Thread Robin Chen

The integer 0 is equal to False, but not Null.

Robin

Kodrik wrote:
> 
> > > If you set $qty=0; then $qty has no value.
> >
> > Of course it has a value.
> 
> No it doesn't have a value.
> PHP interprets 0 as null.
> 
> A very easy way for you to check:
> 
> $value=0;
> 
> if(!$value) printf("$value doesn't have a value (it didn't even print
> 0)\n");
> 
> $value="0"
> if($value) printf("$value does have a value if I put "0" instead of 0\n");
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] How do I convert from perl to php?

2001-11-20 Thread Robin Chen



You don't need to use the $has_empty variable, but I thought it would be
better to just display the message once.

Robin

[EMAIL PROTECTED] wrote:
> 
> I am a perl user trying to convert to php
> 
> how would i turn this perl into php?
> 
> use CGI;
> 
> $name = param(name);
> $address = param(address);
> $phone = param(phone);
> 
> @required = qw( name address phone );
> 
> foreach $key($required)
> {
>  if (!$$key) { &out("You left one empty."); }
> }
> 
> ??
> 
> -
> This message was sent using OlyPen's WebMail.
> http://www.olypen.com
> 
> The original message was received at Tue, 20 Nov 2001 14:05:28 -0800
> from mail.olypen.com [208.200.248.2]
> 
>- The following addresses had permanent fatal errors -
> <[EMAIL PROTECTED]>
> (reason: 550 Host unknown)
> 
>- Transcript of session follows -
> 550 5.1.2 <[EMAIL PROTECTED]>... Host unknown (Name server: lists.php.ne: 
>host not found)
> 
>   
> Reporting-MTA: dns; relay1.olypen.com
> Received-From-MTA: DNS; mail.olypen.com
> Arrival-Date: Tue, 20 Nov 2001 14:05:28 -0800
> 
> Final-Recipient: RFC822; [EMAIL PROTECTED]
> Action: failed
> Status: 5.1.2
> Remote-MTA: DNS; lists.php.ne
> Diagnostic-Code: SMTP; 550 Host unknown
> Last-Attempt-Date: Tue, 20 Nov 2001 14:05:28 -0800
> 
>   
> 
> Subject: Converting from being a perl user
> Date: Tue, 20 Nov 2001 22:08:17 GMT
> From: [EMAIL PROTECTED]
> To: [EMAIL PROTECTED]
> 
> how would i turn this perl into php?
> 
> use CGI;
> 
> $name = param(name);
> $address = param(address);
> $phone = param(phone);
> 
> @required = qw( name address phone );
> 
> foreach $key($required)
> {
>  if (!$$key) { &out("You left one empty."); }
> }
> 
> ??
> 
> -
> This message was sent using OlyPen's WebMail.
> http://www.olypen.com
> 
>   
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] How do I convert from perl to php?

2001-11-20 Thread Robin Chen

Oops, I didn't mean to post the same code that's been posted.  The
subject sorter doesn't work correctly on Netscape Messenger.  I thought
I had finished reading the thread.

My apologies,

Robin

Robin Chen wrote:
> 
>  
> $required = array('name','address','phone');
> $has_empty = 0;
> 
> foreach ($required as $var) {
> if (!is_set($$var)) $has_empty = 1;
> }
> 
> if ($has_empty) print 'You left one empty.';
> 
> ?>
> 
> You don't need to use the $has_empty variable, but I thought it would be
> better to just display the message once.
> 
> Robin
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Mail()'s not playing nicely :(

2001-06-30 Thread Robin Chen

Instead of \n try \r\n

Robin

Jamie Thompson wrote:
> 
> ok so i got
> 
> mail("[EMAIL PROTECTED]", "$message", "sms alert", "Return-Path: $email
> <$email>\nFrom: $email <$email>\nReply-To: $email <$email>\nX-Mailer: " .
> phpversion());
> 
> the email appears as from [EMAIL PROTECTED] istead of [EMAIL PROTECTED] which it
> should (and always has done previousy)
> 
> I looked at the headers and from reply-to and return path are all set ok but
> it sticks in another return path right at the top to [EMAIL PROTECTED]
> 
> wtf is going on?/
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] The future of PHP

2001-08-26 Thread Robin Chen

This is very true.  I have a few ideas that I want to sell, but the only
way that I can do it with PHP is to give out the source, and the user is
expected to know how to install PHP and set up the script.  If I can
compile the PHP script, then I can sell the executables.  The users
would only have to copy the package into a directory and use it like a
cgi, and I won't have to worry about people looking into my codes.

Having executable takes care of 2 concerns I have if I want to sell a
solution.  First, with an executable, users don't have to install PHP on
their system to use my solutions.  Second, users cannot see my code.

Robin

Manuel Lemos wrote:

> 
> No, I mean executables that may be just like VB executables that
> basically contain PHP code compiled into Zend bytecodes or whatever is
> enough for most people be stopped from copy source code directly.
> 
> A lot of people give up PHP because it does not provide affordable
> conditions to let them sell whole applications that others can't still
> their code, when they can just spend only US$100 or less in VB, Delphi,
> Java, Kylix, etc... suite and compile programs that they can distribute
> or sell to others without risking their business.
> 
> There are a lot more other things to say on these subjects, but these
> should give you enough to think for a while. :-)
> 
> Regards,
> Manuel Lemos
> 
> --

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Check whether a page is Google Cached

2009-04-21 Thread Alan Chen
Hi, everyone,

I want to write a small PHP script test.php that can determine whether a 
webpage is Google Cached.

Assuming it is uploaded to www.mysite.com, and I want to use it to check 
whether www.yoursite.com is google cached.

It works as follows:

The user input the query:

http://www.mysite.com/test.php?site=www.yoursite.com

The php script will send the following request to the browser

http://www.google.com/search?q=cache:www.yoursite.com

in the background.

And if the returned result contains a string "This is Google's cache of", 
then the page is cached, so the php script can display

"Your site is cached by Google"

otherwise, it will say

"Your site is not cached by Google"

Just wonder how to implement such a feature, can anyone write a simple 
sample so that I can use as a startpoint as I am a totally new guy in PHP 
coding

Thanks to all of you so much

Alan 



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



Re: [PHP] Check whether a page is Google Cached

2009-04-21 Thread Alan Chen
Thank you so much.

"haliphax"  
дÈëÏûÏ¢ÐÂÎÅ:952625160904210738k494b892dlac3bb1b8e809f...@mail.gmail.com...
> On Tue, Apr 21, 2009 at 8:29 AM, Alan Chen  wrote:
>> Hi, everyone,
>>
>> I want to write a small PHP script test.php that can determine whether a
>> webpage is Google Cached.
>>
>> Assuming it is uploaded to www.mysite.com, and I want to use it to check
>> whether www.yoursite.com is google cached.
>>
>> It works as follows:
>>
>> The user input the query:
>>
>> http://www.mysite.com/test.php?site=www.yoursite.com
>>
>> The php script will send the following request to the browser
>>
>> http://www.google.com/search?q=cache:www.yoursite.com
>>
>> in the background.
>>
>> And if the returned result contains a string "This is Google's cache of",
>> then the page is cached, so the php script can display
>>
>> "Your site is cached by Google"
>>
>> otherwise, it will say
>>
>> "Your site is not cached by Google"
>>
>> Just wonder how to implement such a feature, can anyone write a simple
>> sample so that I can use as a startpoint as I am a totally new guy in PHP
>> coding
>
> You've already laid out most of what needs to be done. I think the
> file_get_contents() function will be your best friend here, provided
> allow_url_fopen has been set to TRUE in your PHP configuration. Take
> the result you get back from that function and parse the 2nd line for
> ">This is Google's cache of <" (I have made this assumption by
> looking at the source of
> http://www.google.com/search?q=cache:www.php.net).
>
> example.php
> ===
>  $url = $_GET['url'];
> $res = file_get_contents('http://www.google.com/search?q=cache:' . $url);
> if($res && strstr('>This is Google's cache of <', $res))
>  echo 'Your page is cached.';
> else
>  echo 'Your page is not cached.';
> ?>
>
> UNTESTED. Hope this helps.
>
>
> -- 
> // Todd 



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



Re: [PHP] HTML errors

2011-01-11 Thread Chen Dong
Hi David:

Quote your attribute value in "..."

On Wed, Jan 12, 2011 at 2:35 PM, David McGlone  wrote:

> Hi Everyone, I'm having a problem validating some links I have in a
> foreach.
> Here is my code:
>   "http://www.w3.org/TR/html4/loose.dtd";>
>
> my PHP code:
> $categorys = array('home', 'services', 'gallery', 'about_us', 'contact_us',
> 'testimonials');
> foreach($categorys as $category){
> $replace = str_replace("_", " ", $category);
> echo "$replace";
> }
>
> Validator Error:
> an attribute value must be a literal unless it contains only name
> characters
>
> …ome>home href=index.php?page=services>services h…
>
> I have tried various combinatons and different doctypes. I'm beginning to
> wonder if this code is allowed at all.
>
>
> --
> Blessings
> David M.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Regards,
CHEN Dong


Re: [PHP] switch case madness

2011-01-18 Thread Chen Dong
Hi,

If it is a string "0", you should use: case "0".
Because in PHP, 0 == false == null. You need to know the difference between
== and ===.

Regards,
Dong Chen

On Wed, Jan 19, 2011 at 2:30 PM, Donovan Brooke  wrote:

> Hello,
>
> I must not understand PHP's switch/case..
> The case '0' below fires when $t_mssg = "" apparently.
> Is this how it's suppose to work? I would think
> it would only fire if it equaled "0".
>
> --
> print "-$t_mssg- ";
>
> if (isset($t_mssg)) {
>  switch ($t_mssg) {
>case 0:
>  echo 'Log In Successful';
>  break;
>  }
> }
> --
>
> TIA,
> Donovan
>
> --
> D Brooke
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Regards,
CHEN Dong


[PHP] php causes HTTP 500, but results in blank page in apache

2011-05-30 Thread Stephon Chen
Hello all,

I use a test script below to generate HTTP 500 status:



It causes HTTP 500 in apache log, but apache shows blank page instead of
HTTP 500 error page
But 403, 404 works correctly.

Why this thing occurs? And is there any soultion?

My platform is FreeBSD 8.2, PHP 5.3.6, and Apache 2.2.18, which running php
as php-cgi mode.

Thanks a lot
--
stephon


Re: [PHP] php causes HTTP 500, but results in blank page in apache

2011-05-31 Thread Stephon Chen
Hello Sean,

Here is my apache config for error handling.
403, 404 works fine, but 500 shows blank page

Alias /errorpage/ "/usr/local/www/apache22/errorpage/"

AllowOverride None
Options -Indexes FollowSymLinks MultiViews
Order allow,deny
Allow from all

#
ErrorDocument 403 /errorpage/403.html
ErrorDocument 404 /errorpage/404.html
ErrorDocument 500 /errorpage/500.html


thanks a lot
--
stephon


On Tue, May 31, 2011 at 21:08, Sean Greenslade wrote:

> Have you checked your apache settings for generating error pages? How is it
> configured to handle 500 errors?
> On May 30, 2011 4:51 AM, "Stephon Chen"  wrote:
> > Hello all,
> >
> > I use a test script below to generate HTTP 500 status:
> >
> >  > header('HTTP/1.1 500 Internal Server Error');
> > ?>
> >
> > It causes HTTP 500 in apache log, but apache shows blank page instead of
> > HTTP 500 error page
> > But 403, 404 works correctly.
> >
> > Why this thing occurs? And is there any soultion?
> >
> > My platform is FreeBSD 8.2, PHP 5.3.6, and Apache 2.2.18, which running
> php
> > as php-cgi mode.
> >
> > Thanks a lot
> > --
> > stephon
>


Re: [PHP] php causes HTTP 500, but results in blank page in apache

2011-05-31 Thread Stephon Chen
All 403, 404, 500.html are static html pages like:


500 error happens


On Wed, Jun 1, 2011 at 14:10, Tamara Temple  wrote:

>
> On May 31, 2011, at 8:14 AM, Stephon Chen wrote:
>
>  Hello Sean,
>>
>> Here is my apache config for error handling.
>> 403, 404 works fine, but 500 shows blank page
>>
>> Alias /errorpage/ "/usr/local/www/apache22/errorpage/"
>> 
>>   AllowOverride None
>>   Options -Indexes FollowSymLinks MultiViews
>>   Order allow,deny
>>   Allow from all
>> 
>> #
>> ErrorDocument 403 /errorpage/403.html
>> ErrorDocument 404 /errorpage/404.html
>> ErrorDocument 500 /errorpage/500.html
>>
>
> What's in 500.html?
>
>


Re: [PHP] php causes HTTP 500, but results in blank page in apache

2011-06-02 Thread Stephon Chen
Hello Sean,

1. while I directed connected to these error pages such as 403, 404, and
500.html,
they works correctly, showing correct error page

2. but while I use something like header('HTTP/1.1 500') to trigger apache
500
the content of 500.html does not show, but blank page only.
both header('HTTP/1.1 403') and header('HTTP/1.1 404') shows the correct
custom error page.

Thanks a lot
--
stephon

On Fri, Jun 3, 2011 at 07:21, Sean Greenslade  wrote:

> So do you get the contents of that page in the response? What happens when
> you browse to that page manually?
> On Jun 1, 2011 2:14 AM, "Stephon Chen"  wrote:
> > All 403, 404, 500.html are static html pages like:
> >
> > 
> > 500 error happens
> > 
> >
> > On Wed, Jun 1, 2011 at 14:10, Tamara Temple 
> wrote:
> >
> >>
> >> On May 31, 2011, at 8:14 AM, Stephon Chen wrote:
> >>
> >> Hello Sean,
> >>>
> >>> Here is my apache config for error handling.
> >>> 403, 404 works fine, but 500 shows blank page
> >>>
> >>> Alias /errorpage/ "/usr/local/www/apache22/errorpage/"
> >>> 
> >>> AllowOverride None
> >>> Options -Indexes FollowSymLinks MultiViews
> >>> Order allow,deny
> >>> Allow from all
> >>> 
> >>> #
> >>> ErrorDocument 403 /errorpage/403.html
> >>> ErrorDocument 404 /errorpage/404.html
> >>> ErrorDocument 500 /errorpage/500.html
> >>>
> >>
> >> What's in 500.html?
> >>
> >>
>


[PHP] Problem of load balance among php-cgi process

2011-10-19 Thread Sean Chen
Hi,

 

I've got a problem when running PHP with nginx, there are several php-cgi
processes and only one is busy at one time, like this:

 

500  23868  0.0  0.0 209164 10948 ?S21:23   0:01
/usr/local/websrv/php/bin/php-cgi --fpm --fpm-config
/usr/local/websrv/php/etc/php-fpm.conf

500  23871  0.0  0.0 209136 10684 ?S21:23   0:01
/usr/local/websrv/php/bin/php-cgi --fpm --fpm-config
/usr/local/websrv/php/etc/php-fpm.conf

500  23872  0.0  0.0 209136 10732 ?S21:23   0:01
/usr/local/websrv/php/bin/php-cgi --fpm --fpm-config
/usr/local/websrv/php/etc/php-fpm.conf

500  23873  0.0  0.0 209136 10712 ?S21:23   0:01
/usr/local/websrv/php/bin/php-cgi --fpm --fpm-config
/usr/local/websrv/php/etc/php-fpm.conf

500  23874  0.0  0.0 209076 10576 ?S21:23   0:01
/usr/local/websrv/php/bin/php-cgi --fpm --fpm-config
/usr/local/websrv/php/etc/php-fpm.conf

500  23875  0.0  0.0 209136 10976 ?S21:23   0:01
/usr/local/websrv/php/bin/php-cgi --fpm --fpm-config
/usr/local/websrv/php/etc/php-fpm.conf

500  23876  0.0  0.0 209136 10796 ?S21:23   0:01
/usr/local/websrv/php/bin/php-cgi --fpm --fpm-config
/usr/local/websrv/php/etc/php-fpm.conf

500  23877  0.0  0.0 209136 11068 ?S21:23   0:01
/usr/local/websrv/php/bin/php-cgi --fpm --fpm-config
/usr/local/websrv/php/etc/php-fpm.conf

500  23878  0.0  0.0 209136 10708 ?S21:23   0:01
/usr/local/websrv/php/bin/php-cgi --fpm --fpm-config
/usr/local/websrv/php/etc/php-fpm.conf

500  23879  0.0  0.0 209136 10960 ?S21:23   0:01
/usr/local/websrv/php/bin/php-cgi --fpm --fpm-config
/usr/local/websrv/php/etc/php-fpm.conf

500  23880  0.0  0.0 209136 10832 ?S21:23   0:01
/usr/local/websrv/php/bin/php-cgi --fpm --fpm-config
/usr/local/websrv/php/etc/php-fpm.conf

500  27195 15.0  0.1 210196 12644 ?S23:02   0:02
/usr/local/websrv/php/bin/php-cgi --fpm --fpm-config
/usr/local/websrv/php/etc/php-fpm.conf

 

The red one is busy, and other php-cgi processes is cpu free, cpu load is
about 20% total, with lot of free memory, disk and network io status is
fine,

and mean time, response of HTTP request to this server is very slow.

 

The cpu load of php-cgi processes return normal when I restart the php-fpm
service (each process takes some cpu slice which means they are all working
I think). But, after several minutes, the problem appears again and again.

 

what's wrong with my php-cgi?

 

PS: how do I debug or monitor the php program running status when it goes
wrong?

 

versions:

php: 5.2.17

nginx: 5.8.55

OS: CentOS 5.6 64-bit

 

Regards

Sean

 



[PHP] Re: Problem of load balance among php-cgi process

2011-10-20 Thread sean chen
It's cause by eaccelerator module, when I remove this module, the php-cgi
works well.
Is there some compatible issue between eaccelerator and php?

Regards
Sean

2011/10/19 Sean Chen 

>  Hi,
>
> ** **
>
> I’ve got a problem when running PHP with nginx, there are several php-cgi
> processes and only one is busy at one time, like this:
>
> ** **
>
> 500  23868  0.0  0.0 209164 10948 ?S21:23   0:01
> /usr/local/websrv/php/bin/php-cgi --fpm --fpm-config
> /usr/local/websrv/php/etc/php-fpm.conf
>
> 500  23871  0.0  0.0 209136 10684 ?S21:23   0:01
> /usr/local/websrv/php/bin/php-cgi --fpm --fpm-config
> /usr/local/websrv/php/etc/php-fpm.conf
>
> 500  23872  0.0  0.0 209136 10732 ?S21:23   0:01
> /usr/local/websrv/php/bin/php-cgi --fpm --fpm-config
> /usr/local/websrv/php/etc/php-fpm.conf
>
> 500  23873  0.0  0.0 209136 10712 ?S21:23   0:01
> /usr/local/websrv/php/bin/php-cgi --fpm --fpm-config
> /usr/local/websrv/php/etc/php-fpm.conf
>
> 500  23874  0.0  0.0 209076 10576 ?S21:23   0:01
> /usr/local/websrv/php/bin/php-cgi --fpm --fpm-config
> /usr/local/websrv/php/etc/php-fpm.conf
>
> 500  23875  0.0  0.0 209136 10976 ?S21:23   0:01
> /usr/local/websrv/php/bin/php-cgi --fpm --fpm-config
> /usr/local/websrv/php/etc/php-fpm.conf
>
> 500  23876  0.0  0.0 209136 10796 ?S21:23   0:01
> /usr/local/websrv/php/bin/php-cgi --fpm --fpm-config
> /usr/local/websrv/php/etc/php-fpm.conf
>
> 500  23877  0.0  0.0 209136 11068 ?S21:23   0:01
> /usr/local/websrv/php/bin/php-cgi --fpm --fpm-config
> /usr/local/websrv/php/etc/php-fpm.conf
>
> 500  23878  0.0  0.0 209136 10708 ?S21:23   0:01
> /usr/local/websrv/php/bin/php-cgi --fpm --fpm-config
> /usr/local/websrv/php/etc/php-fpm.conf
>
> 500  23879  0.0  0.0 209136 10960 ?S21:23   0:01
> /usr/local/websrv/php/bin/php-cgi --fpm --fpm-config
> /usr/local/websrv/php/etc/php-fpm.conf
>
> 500  23880  0.0  0.0 209136 10832 ?S21:23   0:01
> /usr/local/websrv/php/bin/php-cgi --fpm --fpm-config
> /usr/local/websrv/php/etc/php-fpm.conf
>
> 500  *27195 15.0*  0.1 210196 12644 ?S23:02   0:02
> /usr/local/websrv/php/bin/php-cgi --fpm --fpm-config
> /usr/local/websrv/php/etc/php-fpm.conf
>
> ** **
>
> The red one is busy, and other php-cgi processes is cpu free, cpu load is
> about 20% total, with lot of free memory, disk and network io status is
> fine,
>
> and mean time, response of HTTP request to this server is very slow.
>
> ** **
>
> The cpu load of php-cgi processes return normal when I restart the php-fpm
> service (each process takes some cpu slice which means they are all working
> I think). But, after several minutes, the problem appears again and again…
> 
>
> ** **
>
> what’s wrong with my php-cgi?
>
> ** **
>
> PS: how do I debug or monitor the php program running status when it goes
> wrong?
>
> ** **
>
> versions:
>
> php: 5.2.17
>
> nginx: 5.8.55
>
> OS: CentOS 5.6 64-bit
>
> ** **
>
> Regards
>
> Sean
>
> ** **
>


[PHP] 答复: [PHP] Re: Problem of load balance among php-cgi process

2011-10-20 Thread Sean Chen
lol.
The last one:

500  23880  0.0  0.0 209136 10832 ?S21:23   0:01 
/usr/local/websrv/php/bin/php-cgi --fpm --fpm-config 
/usr/local/websrv/php/etc/php-fpm.conf
500  27195 15.0  0.1 210196 12644 ?S23:02   0:02 
/usr/local/websrv/php/bin/php-cgi --fpm --fpm-config 
/usr/local/websrv/php/etc/php-fpm.conf <- THIS ONE

PS: The problem is solved, It's cause by eaccelerator module, when I remove 
this module, the php-cgi works well.

Regards.
Sean

-邮件原件-

On 10/20/2011 5:20 AM, sean chen wrote:

>> The red one is busy

My email client is color blind.

-- 
Jim Lucas

http://www.cmsws.com/
http://www.cmsws.com/examples/
http://www.bendsource.com/

C - (541) 408-5189
O - (541) 323-9113
H - (541) 323-4219


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



[PHP] PHP preg_replace_callback with unicode

2012-03-30 Thread Jimmy Chen
I wrote a simple script below to simulate my problem.
Both my string and pattern contain unicode characters.

Basically, if I run it from command line (php -f test.php), it prints
"match" as expected.

But if I run it through web server (apache, http://localhost/test.php), it
prints "no match".

I am using PHP 5.3.
I am sure both use the same php.ini.

Any idea why it behaves differently?
How do I make it work through web server?


Thanks
-

 0) {
echo "match";
} else {
echo 'no match';
}
?>



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



[PHP] I have some upload questions.

2005-05-15 Thread Lee Chen
If the server uses hub ( to make more computer connect online),  can' I
upload files
to that server??

I face a problem like this ,  and I think that's the hub causing this
problem.
Did it?

or if I can do something to solve this problem?

(btw I am the administrator of that server. I can do anything on that
server)

Thanks.

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



[PHP] Re: I have some upload questions.

2005-05-16 Thread Lee Chen
Thanks for all of your helping.

I think now maybe it's not the serve's problem because I CAN post forms and
even I can upload some smaller size files.
Then the following is my problem:

This is the script of " justtest.php" :

justtest.php







I can upload a file of size 7KB, but when I want to upload a file of 20 or
30MB, it says :
Fatal error: Maximum execution time of 30 seconds exceeded in justtest.php
on line 2

That means it took too long time to upload?
But when I add some function to this script something like this:







I add "two" set_time_limit(0)but when I want to upload a file of 20or
30MB, it still shows:
Fatal error: Maximum execution time of 30 seconds exceeded in justtest.php
on line 2

the same line?  So the POST action didn't complete? I don't understand.
(AND I can upload a file of 7KB successfully without any problems)

The following is some settings in the php.ini:

post_max_size 200M
upload_max_filesize 200M
memory_limit 200M
max_execution_time 30
max_input_time 60


And is there anything I should set?

BTW, if I put this php file on OTHER server whose settings like this:
post_max_size 100M
upload_max_filesize 100M
memory_limit 8M
max_execution_time 30
max_input_time 60

It can work well, no matter the filesize is 30MB or 7KB.


So I just wonder what I should do to solve this problem.  (now I think it's
not the hub's fault)
Thanks.




"Lee Chen" <[EMAIL PROTECTED]> ¼¶¼g©ó¶l¥ó·s»D
:[EMAIL PROTECTED]
> If the server uses hub ( to make more computer connect online),  can' I
> upload files
> to that server??
>
> I face a problem like this ,  and I think that's the hub causing this
> problem.
> Did it?
>
> or if I can do something to solve this problem?
>
> (btw I am the administrator of that server. I can do anything on that
> server)
>
> Thanks.

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



Re: [PHP] Re: I have some upload questions.

2005-05-16 Thread Lee Chen
Thanks
I check the phpinfo, and my safe_mode is off.
This is my phpinfo
http://homepage.ntu.edu.tw/~b91401010/phpinfo().htm
It is just a copy, not on the server.(so it's html file, not a php file)

Thanks.

- Original Message -
From: "Marek Kilimajer" <[EMAIL PROTECTED]>
To: "Lee Chen" <[EMAIL PROTECTED]>
Cc: 
Sent: Monday, May 16, 2005 11:26 PM
Subject: Re: [PHP] Re: I have some upload questions.


> Lee Chen wrote:
> > Thanks for all of your helping.
> >
> > I think now maybe it's not the serve's problem because I CAN post forms
and
> > even I can upload some smaller size files.
> > Then the following is my problem:
> >
> > This is the script of " justtest.php" :
> >
> > justtest.php
> >  > if (is_uploaded_file($_FILES["upload"]['tmp_name']))
> > {
> > $full_path = "D:/xxx/xxx.pdf";
> > move_uploaded_file($_FILES["upload"]['tmp_name'], "$full_path");
> > }
> > ?>
> > 
> > 
> > 
> >
> >
> >
> > I can upload a file of size 7KB, but when I want to upload a file of 20
or
> > 30MB, it says :
> > Fatal error: Maximum execution time of 30 seconds exceeded in
justtest.php
> > on line 2
> >
> > That means it took too long time to upload?
> > But when I add some function to this script something like this:
> >
> >  > set_time_limit(0);
> > if (is_uploaded_file($_FILES["upload"]['tmp_name']))
> > {
> > $full_path = "D:/xxx/xxx.pdf";
> > move_uploaded_file($_FILES["upload"]['tmp_name'], "$full_path") ;
> > }
> > set_time_limit(0);
> > ?>
> > 
> > 
> > 
> >
> >
> > I add "two" set_time_limit(0)but when I want to upload a file of
20or
> > 30MB, it still shows:
> > Fatal error: Maximum execution time of 30 seconds exceeded in
justtest.php
> > on line 2
>
> Is safe_mode on? set_time_limit() has no effect when PHP is running in
> safe mode.
>
>

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



Re: [PHP] Re: I have some upload questions.

2005-05-16 Thread Lee Chen
btw, even if I set max_execution_time = 0in the php.ini,
I still CAN'T upload a file of 30MB.
and it still shows the same message:
Fatal error: Maximum execution time of 0 seconds exceeded in justtest.php on
line 2

I just don't understand how it can exceed a max execution time of  "0".
Anything wrong?

THANKS.

"Marek Kilimajer" <[EMAIL PROTECTED]>
???:[EMAIL PROTECTED]
> Lee Chen wrote:
> > Thanks for all of your helping.
> >
> > I think now maybe it's not the serve's problem because I CAN post forms
and
> > even I can upload some smaller size files.
> > Then the following is my problem:
> >
> > This is the script of " justtest.php" :
> >
> > justtest.php
> >  > if (is_uploaded_file($_FILES["upload"]['tmp_name']))
> > {
> > $full_path = "D:/xxx/xxx.pdf";
> > move_uploaded_file($_FILES["upload"]['tmp_name'], "$full_path");
> > }
> > ?>
> > 
> > 
> > 
> >
> >
> >
> > I can upload a file of size 7KB, but when I want to upload a file of 20
or
> > 30MB, it says :
> > Fatal error: Maximum execution time of 30 seconds exceeded in
justtest.php
> > on line 2
> >
> > That means it took too long time to upload?
> > But when I add some function to this script something like this:
> >
> >  > set_time_limit(0);
> > if (is_uploaded_file($_FILES["upload"]['tmp_name']))
> > {
> > $full_path = "D:/xxx/xxx.pdf";
> > move_uploaded_file($_FILES["upload"]['tmp_name'], "$full_path") ;
> > }
> > set_time_limit(0);
> > ?>
> > 
> > 
> > 
> >
> >
> > I add "two" set_time_limit(0)but when I want to upload a file of
20or
> > 30MB, it still shows:
> > Fatal error: Maximum execution time of 30 seconds exceeded in
justtest.php
> > on line 2
>
> Is safe_mode on? set_time_limit() has no effect when PHP is running in
> safe mode.

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



Re: [PHP] Re: I have some upload questions.

2005-05-17 Thread Lee Chen

"James E Hicks III" <[EMAIL PROTECTED]>
???:[EMAIL PROTECTED]
> Lee Chen wrote:
>
> >Thanks
> >I check the phpinfo, and my safe_mode is off.
> >This is my phpinfo
> >http://homepage.ntu.edu.tw/~b91401010/phpinfo().htm
> >It is just a copy, not on the server.(so it's html file, not a php
file)
> >
> >Thanks.
> >
> >
> Looks like you need to check this in your php.ini file. Could be your
> problem!
>
> max_input_time integer
>
>  This sets the maximum time in seconds a script is allowed to receive
> input data, like POST, GET and file uploads.
>
>
>
> James Hicks

Thanks for your anwsering.

I still have some questions   that if I put the same php file   on the OTHER
server whose settings are like this:
http://homepage.ntu.edu.tw/~b91401010/phpinfo()1.htm

With the samemax_input_time value "60"  ,   I can upload a file of 30MB
successfully and I'm very sure that  the duration of uploading files
was exceeding "5 minutes"without seeing any message like :Fatal error:
Maximum execution time of 0 seconds exceeded in justtest.php on
line 2

I don't know what's the difference between the two servers about some
settings.
With almost the same settings, but it made different results.
I'm confused.

Please help me solve this problem.   Did I have some settings
wrong?
Thanks.

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



[PHP] version difference or server difference?

2005-05-18 Thread Lee Chen
Why does a Win2K installation of PHP honor max_input_time and a FreeBSD
machine does not?

I am running version 5.0.0b2-dev on the windows
machine and version 4.3.10 on the BSD machine would the version
difference cause this problem?

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



Re: [PHP] Which PHP-Editor to use?

2007-10-18 Thread Chen Lei

Matt Arnilo S. Baluyos (Mailing Lists) 写道:

On 10/18/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
  

2007/10/18, Matt Arnilo S. Baluyos (Mailing Lists)
<[EMAIL PROTECTED]>:


Does Eclipse already have word-wrap?

To my disappointment, it was still lacking that basic functionality
the last time I tried it.
  

PHP Eclipse's auto format code?



Hmmm. Not so sure if that's the name they use for such feature. But
something that does basic word-wrapping for Eclipse.

  
When press Return inside a string, it auto generate " . " at the point, 
and split to two lines, like this:

$str = "asf asdflk jasfdljaserija slfdkjalsdjtoia sjdflk ajsotiu " .
"aslfdj atsujaoisdjfalstjioaew fasd";
It provide the Code Formatter, but the code formatted not pretty well!

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



Re: [PHP] EMPTY??

2007-10-24 Thread Chen Lei

Can you show us the form tag of your php file(html code)?

Dan Shirah 写道:

doing a var_dump($_POST['comments'];

returns  string(0) ""

So the value of $comments in $comments = $_POST['comments']; SHOULD be equal
to 0 or "", right?

In which case when I do my original:

if (!empty($comments)) {
  echo "Do Something";
}

It SHOULD just bypass that and continue with my code, but instead it gives
me the error, "Changed database context to Database."


On 10/23/07, Nathan Nobbe <[EMAIL PROTECTED]> wrote:
  

On 10/23/07, Dan Shirah <[EMAIL PROTECTED]> wrote:


I made two variables for the same posted value because I believe empty()
does not work with strtoupper in front of the value. It only works with
a
standalone variable, correct?
  

no; strtoupper modifies its argument, that is all.
empty evaluates the argument it is given that is all.
therefore, if empty is passed an string with no contents that has been
passed through
strtoupper, it will still be regarded as empty.







When comments is left blank and I echo out the value for $check_comments
it
returns nothing at all which is why I think empty() or "" should work,
but
they don't.
  

try using var_dump(); you will see that it is a string that has no
contents, or perhaps some
whitespace characters.


-nathan






  


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



[PHP] [QUESTION] MAIL: Send a NOOP instead of DATA

2008-01-15 Thread Wang Chen
I wrote a class to send mail by remote mail server.
But it was failed. So I captured the network packets by tcpdump,
and found that there is a strange packet "NOOP" was sent.
But in the source code I mean to send command "DATA".
I don't know why a "NOOP" packet was sent instead.

Here is my php source code and the attachment is tcpdump file.

---
smtp=$config['smtp_svr'];
if(empty($welcome)){
$this->welcome=gethostbyaddr($_SERVER['REMOTE_ADDR']);
}else{
$this->welcome=$welcome;
}

$this->lastmessage="";
$this->lastact="";
$this->port=$config['smtp_port'];
$this->user = base64_encode($config['smtp_user']);
$this->pass = base64_encode($config['smtp_pass']);
}

/**
 * Exe command such as HELO, MAIL FROM, RCPT TO, QUIT, DATA
 * $code:   reply code
 */
function do_command($command, $code)
{
$this->lastact=$command;

fputs ( $this->fp, $this->lastact );
$this->lastmessage = fgets ( $this->fp, 512 );

if(!ereg("^$code", $this->lastmessage)) {
return false;
} else {
return true;
}
}

/**
 * Send mail
 * $to: the mail address of receiver
 * $subject:the subject of mail
 * $message:mail content
 * return:  true -- successful
 *  false -- fail
 */
function send( $to,$subject,$message)
{
global $config;
$from=$config['smtp_from'];

/* Connect to server. */
$this->lastact="connect";

$this->show_debug("Connect to SMTP server : 
".$this->smtp,"out");
$this->fp = fsockopen ( $this->smtp, $this->port );
if ( $this->fp ) {
set_socket_blocking( $this->fp, true );
$this->lastmessage=fgets($this->fp,512);

/* reply 220 means connect sucessfully */
if (! ereg ( "^220", $this->lastmessage ) ) {
return false;
} else {
$this->lastact="HELO " . $this->welcome . "\n";
if(!$this->do_command($this->lastact, "250")){
fclose($this->fp);
return false;
}

$this->lastact="AUTH   LOGIN\r\n";
if(!$this->do_command($this->lastact, "334")){
fclose($this->fp);
return false;
}
$this->lastact=$this->user."\r\n";
if(!$this->do_command($this->lastact, "334")){
fclose($this->fp);
return false;
}
$this->lastact=$this->pass."\r\n";
if(!$this->do_command($this->lastact, "235")){
fclose($this->fp);
return false;
}

$this->lastact="MAIL FROM: $from" . "\n";
if(!$this->do_command($this->lastact, "250")) {
fclose($this->fp);
return false;
}

$this->lastact="RCPT TO: $to" . "\n";
if(!$this->do_command($this->lastact, "250")) {
fclose($this->fp);
return false;
}

/* Send data, I send a command "DATA", but 
tcpdump capture a "NOOP" packet */
$this->lastact="DATA\n";
if(!$this->do_command($this->lastact, "354")) {
fclose($this->fp);
return false;
}

/* Insert Conten-Type */
$message = "Content-Transfer-Encoding: 
8bit\n".$message;
$message = "Content-Type: text/plain; 
charset=UTF-8\n".$message;
$message = "MIME-Version: 1.0\n".$message;

/* Deal with subject header */
 

Re: [PHP] [QUESTION] MAIL: Send a NOOP instead of DATA

2008-01-15 Thread Wang Chen
Wang Chen said the following on 2008-1-16 11:38:
> I wrote a class to send mail by remote mail server.
> But it was failed. So I captured the network packets by tcpdump,
> and found that there is a strange packet "NOOP" was sent.
> But in the source code I mean to send command "DATA".
> I don't know why a "NOOP" packet was sent instead.
> 
> Here is my php source code and the attachment is tcpdump file.
> 

Seems that php-general maillist server can not accept attachment.
I have to describe the tcpdump capture information here.

snip
snd:HELLO
rcv:250
snd:AUTH LOGIN
rcv:334
snip/* all ok */
snd:RCPT TO: [EMAIL PROTECTED]
rcv:250 OK
/* 30 second wait...? it's odd */
snd:NOOP/* it should be DATA, why NOOP? */
rcv:250 OK
snip

I use outlook to sent a same mail and captured right packets.
snip
snd:HELLO
rcv:250
snd:AUTH LOGIN
rcv:334
snip
snd:RCPT TO: [EMAIL PROTECTED]
rcv:250 OK
snd:DATA
rcv:354 Start mail input
snd:Message body
rcv:250 OK
snip

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



[PHP] Re: [QUESTION] MAIL: Send a NOOP instead of DATA

2008-01-15 Thread Wang Chen
Manuel Lemos said the following on 2008-1-16 11:55:
> Maybe you are accessing a SMTP server with a grey listing or
> anti-spam/anti-virus frontend that sits on the front of the actual SMTP
> server and only passes information to the backend server when it is ready.
> 
> It is possible that your message is malformed and the frontend server is
> expecting something that you are not sending correctly. Meanwhile the
> frontend server sends NOOP commands to the backend server to keep the
> connection opened.
> 

But it's strange that php should send a "DATA" command out, but tcpdump didn't
capture this packet. :(

> You may want to try this SMTP class that is known to work correctly
> according to the mail standards. See if you can send the message
> properly. If so, the theory above is likely to be the case.
> 
> http://www.phpclasses.org/smtpclass
> 
> If you need authentication, you also need this:
> 
> http://www.phpclasses.org/sasl
> 
> 

Thanks Manuel, I will try this.

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



[PHP] Re: [QUESTION] MAIL: Send a NOOP instead of DATA

2008-01-15 Thread Wang Chen
Manuel Lemos said the following on 2008-1-16 13:14:
>> But it's strange that php should send a "DATA" command out, but tcpdump 
>> didn't
>> capture this packet. :(
> 
> I don't know why you are using tcpdump, but maybe you are only capturing
> a network interface that is not the one that your code used to connect
> to the SMTP server. It seems to me that is something is altering the
> data you are sending for some reason. I suggest that you ask your system
> administrator.
> 

For debugging my code, I use tcpdump to capture packets and compare the 
difference
between outlook's packets and php's packets.
By the way, i only have one NIC.

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



Re: [PHP] Re: [QUESTION] MAIL: Send a NOOP instead of DATA

2008-01-15 Thread Wang Chen
mike said the following on 2008-1-16 12:11:
> Why not look at phpmailer? Probably more robust than some random classes.
> 
> http://phpmailer.codeworxtech.com/
> 

Thanks Mike. I will try both and tell you guys I like which one.

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



[PHP] How to pass POST data to php-cgi

2008-03-16 Thread Hui Chen
Hi,

I'm writing a simple httpd with php support via cgi/fastcgi. I tried several
ways to pass POST data to php-cgi (by writing to child process's stdin from
parent process), however, none of them worked

Here's the most simple not working example:

$ export CONTENT_LENGTH=4; export HTTP_METHOD=POST; echo 's=33' | php-cgi
test.php

and test.php has only one line:



Running it gave me:

X-Powered-By: PHP/5.2.3-1ubuntu6.3
Content-type: text/html


Notice:  Undefined index:  s in /home/chen/temp/test.php on
line 1

Please help me figure out what's missing. Part of php-cgi's phpinfo() output
is attached, I will provide more if you need.

Thanks in advance,
Hui

=phpinfo() output==
_SERVER["TERM"]xterm
_SERVER["SHELL"]/bin/bash
_SERVER["SSH_TTY"]/dev/pts/1
_SERVER["CONTENT_LENG"]4
_SERVER["LD_LIBRARY_PATH"]/usr/local/lib
_SERVER["LS_COLORS"]no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.flac=01;35:*.mp3=01;35:*.mpc=01;35:*.ogg=01;35:*.wav=01;35:
_SERVER["LANG"]en_US.UTF-8
_SERVER["HISTCONTROL"]ignoredups
_SERVER["SHLVL"]1
_SERVER["CONTENT_LENGTH"]4
_SERVER["LESSOPEN"]| /usr/bin/lesspipe %s
_SERVER["HTTP_METHOD"]POST
_SERVER["CONTENT_TYPE"]application/x-www-f­orm-urlencoded
_SERVER["LESSCLOSE"]/usr/bin/lesspipe %s %s
_SERVER["_"]/usr/bin/php-cgi
_SERVER["PHP_SELF"]no value
_SERVER["REQUEST_TIME"]1205702297
_SERVER["argv"]Array
(
[0] => phpinfo.php
)


_SERVER["argc"]1
_ENV["TERM"]xterm
_ENV["SHELL"]/bin/bash
_ENV["SSH_TTY"]/dev/pts/1
_ENV["CONTENT_LENG"]4
_ENV["LD_LIBRARY_PATH"]/usr/local/lib
_ENV["LS_COLORS"]no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.flac=01;35:*.mp3=01;35:*.mpc=01;35:*.ogg=01;35:*.wav=01;35:
_ENV["LANG"]en_US.UTF-8
_ENV["HISTCONTROL"]ignoredups
_ENV["SHLVL"]1
_ENV["CONTENT_LENGTH"]4
_ENV["LESSOPEN"]| /usr/bin/lesspipe %s
_ENV["HTTP_METHOD"]POST
_ENV["CONTENT_TYPE"]application/x-www-f­orm-urlencoded
_ENV["LESSCLOSE"]/usr/bin/lesspipe %s %s
_ENV["_"]/usr/bin/php-cgi


[PHP] Re: How to pass POST data to php-cgi

2008-03-16 Thread Hui Chen
I solved the problem myself.

Following command works:

export CONTENT_LENGTH=4; export REQUEST_METHOD=POST; export SCRIPT_FILENAME=
test.php ; export CONTENT_TYPE=application/x-www-form-urlencoded;  echo s=44
| php-cgi

output:

X-Powered-By: PHP/5.2.3-1ubuntu6.3
Content-type: text/html

44

a working C fork/exec example is also attached.

=== test.c ===

#include 
#include 
#include 

main()
{
int outfd[2];
int infd[2];
int oldstdin, oldstdout;
pipe(outfd); // Where the parent is going to write to
pipe(infd); // From where parent is going to read
if(!fork())
{
close(0);
close(1);
dup2(outfd[0], 0); // Make the read end of outfd pipe as stdin
dup2(infd[1],1); // Make the write end of infd as stdout
setenv("CONTENT_LENGTH", "4", 1);
setenv("REQUEST_METHOD", "POST", 1);
setenv("SCRIPT_FILENAME", "test.php", 1);
setenv("CONTENT_TYPE", "application/x-www-form-urlencoded", 1);
execl("/usr/bin/php-cgi","/usr/bin/php-cgi", NULL);
}
else
{

char output[1000];
close(outfd[0]); // These are being used by the child
write(outfd[1],"s=444", 5); // Write to child's stdin
close(outfd[1]);
close(infd[1]);
output[read(infd[0],output,1000)] = 0; // Read from child's stdout
printf("%s", output);
}
}


On Sun, Mar 16, 2008 at 4:30 PM, Hui Chen <[EMAIL PROTECTED]> wrote:

> Hi,
>
> I'm writing a simple httpd with php support via cgi/fastcgi. I tried
> several ways to pass POST data to php-cgi (by writing to child process's
> stdin from parent process), however, none of them worked
>
> Here's the most simple not working example:
>
> $ export CONTENT_LENGTH=4; export HTTP_METHOD=POST; echo 's=33' | php-cgi
> test.php
>
> and test.php has only one line:
>
> 
>
> Running it gave me:
>
> X-Powered-By: PHP/5.2.3-1ubuntu6.3
> Content-type: text/html
>
> 
> Notice:  Undefined index:  s in /home/chen/temp/test.php on
> line 1
>
> Please help me figure out what's missing. Part of php-cgi's phpinfo()
> output is attached, I will provide more if you need.
>
> Thanks in advance,
> Hui
>
> =phpinfo() output==
> _SERVER["TERM"]xterm
> _SERVER["SHELL"]/bin/bash
> _SERVER["SSH_TTY"]/dev/pts/1
> _SERVER["CONTENT_LENG"]4
> _SERVER["LD_LIBRARY_PATH"]/usr/local/lib
>
> _SERVER["LS_COLORS"]no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.flac=01;35:*.mp3=01;35:*.mpc=01;35:*.ogg=01;35:*.wav=01;35:
> _SERVER["LANG"]en_US.UTF-8
> _SERVER["HISTCONTROL"]ignoredups
> _SERVER["SHLVL"]1
> _SERVER["CONTENT_LENGTH"]4
> _SERVER["LESSOPEN"]| /usr/bin/lesspipe %s
> _SERVER["HTTP_METHOD"]POST
> _SERVER["CONTENT_TYPE"]application/x-www-f­orm-urlencoded
> _SERVER["LESSCLOSE"]/usr/bin/lesspipe %s %s
> _SERVER["_"]/usr/bin/php-cgi
> _SERVER["PHP_SELF"]no value
> _SERVER["REQUEST_TIME"]1205702297
> _SERVER["argv"]Array
> (
> [0] => phpinfo.php
> )
> 
>
> _SERVER["argc"]1
> _ENV["TERM"]xterm
> _ENV["SHELL"]/bin/bash
> _ENV["SSH_TTY"]/dev/pts/1
> _ENV["CONTENT_LENG"]4
> _ENV["LD_LIBRARY_PATH"]/usr/local/lib
>
> _ENV["LS_COLORS"]no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.flac=01;35:*.mp3=01;35:*.mpc=01;35:*.ogg=01;35:*.wav=01;35:
> _ENV["LANG"]en_US.UTF-8
> _ENV["HISTCONTROL"]ignoredups
> _ENV["SHLVL"]1
> _ENV["CONTENT_LENGTH"]4
> _ENV["LESSOPEN"]| /usr/bin/lesspipe %s
> _ENV["HTTP_METHOD"]POST
> _ENV["CONTENT_TYPE"]application/x-www-f­orm-urlencoded
> _ENV["LESSCLOSE"]/usr/bin/lesspipe %s %s
> _ENV["_"]/usr/bin/php-cgi
>
>


[PHP] Add buttons on the fly

2006-10-31 Thread Wang Chen

I would like to add two buttons on a page form infomation confirmation,
however, the html code in php nest can not be known by browser if  I put
   into there.
Besically, there is a mail form to enter iterm infomaiton, if it exist
before, prompt its iterm id., if it is new, query a next available inerm id
for it, then, show a page to ask such as, "do you accept this id?", two
buttons below this question, yes and no.

Is there any fountion in php which can make it?  Thanks.


[PHP] pass value to next page

2006-11-07 Thread Wang Chen

Hi ,

Newbie question, I have a form,

  
  input .
  input...
  ...
  

The search.php3 goes to query mysql database to see if the infomation is new
or existed, if new, will promt
two radio buttons ( Yes or No)  to confirm if you like to enter the info
inot DB .The form will action="result.php"
My question is how we can passwd the values which are entered in first page
to result.php page.

Thank you for your help


Re: [PHP] pass value to next page

2006-11-07 Thread Wang Chen

Thanks much, y'all.  Forgive to my typo on the original email.

On 11/7/06, Jochem Maas <[EMAIL PROTECTED]> wrote:


Wang Chen wrote:
> Hi ,
>
> Newbie question, I have a form,
>
>   
>   input .
>   input...
>   ...
>   
>
> The search.php3 goes to query mysql database to see if the infomation is

.php3 extension is, I would say, discouraged. just use .php

> new
> or existed, if new, will promt
> two radio buttons ( Yes or No)  to confirm if you like to enter the info
> inot DB .The form will action="result.php"

2 options:

1. php solution, put the data in $_SESSION and retrieve it
again when you have the 'insert' confirmation - (search the manual for
session usage)

2. html solution, in the second form put the inputs from the first form,
set all their
type attributes to hidden and set the value accodingly:




> My question is how we can passwd the values which are entered in first
page

looks like you mean pass not passwd :-)

> to result.php page.
>
> Thank you for your help
>




[PHP] Crash in PHP5RC1 but can't find where

2004-03-24 Thread David Chen
Hi,

My application crashes, but I have a hard time figuring out where because it
only happens periodically.

For some reason, it only crashes about 10% of the time. If someone who knows
how to debug PHP could assist me, that would be very nice. You may download
the package at: http://www.blesys.com/uploads/Web%20app.rar
After extracting the file, go to the file: test/Test.php
And keep refreshing until it crashes.
My system is Win XP Pro with Apache 2 with PHP5RC1 (downloaded 3/24/04)

This application is an output from a Java->PHP translator. I believe it
started crashing a month ago (but it could be a feature I added). It's a bit
slow (takes ~.5 seconds on my computer) because of an OOP persistence layer.

Right now, I include a lineLog.html output to try to find where the crash
is, but it's not too helpful.

Thanks.


David Chen

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



Re: [PHP] Crash in PHP5RC1 but can't find where

2004-03-25 Thread David Chen
Hi Red,

I don't think my problem is caused by debug_backtrace()

Perhaps I'll try apache1.3... I guess for now I'll just lie low so that a
PHP5 debugger will be released, and then I can use that to find out what's
going on. Kind of ridiculous to release something that still crashes, but oh
well... no debugger until it's released officially.

Thanks.

David Chen

"Red Wingate" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Hi David,

same thing i reported to the PHP-DEV List some time ago ( before RC1
was released ). The problem is the Win32/Apache2 Combination you
are using.

I am not completely sure, but it looks like debug_backtrace(); causes
this crash. Maybe look at my little script for details:

http://download.erisx.de/crash.txt

 -- red

Am Donnerstag, 25. März 2004 05:53 schrieb David Chen:
> Hi,
>
> My application crashes, but I have a hard time figuring out where because
> it only happens periodically.
>
> For some reason, it only crashes about 10% of the time. If someone who
> knows how to debug PHP could assist me, that would be very nice. You may
> download the package at: http://www.blesys.com/uploads/Web%20app.rar
> After extracting the file, go to the file: test/Test.php
> And keep refreshing until it crashes.
> My system is Win XP Pro with Apache 2 with PHP5RC1 (downloaded 3/24/04)
>
> This application is an output from a Java->PHP translator. I believe it
> started crashing a month ago (but it could be a feature I added). It's a
> bit slow (takes ~.5 seconds on my computer) because of an OOP persistence
> layer.
>
> Right now, I include a lineLog.html output to try to find where the crash
> is, but it's not too helpful.
>
> Thanks.
>
>
> David Chen

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



[PHP] Crash in PHP5RC1 but can't find where

2004-03-29 Thread David Chen
Hi,

My application crashes, but I have a hard time figuring out where because it
only happens periodically.

For some reason, it only crashes about 10% of the time. If someone who knows
how to debug PHP could assist me, that would be very nice. You may download
the package at: http://www.blesys.com/uploads/Web%20app.rar
After extracting the file, go to the file: test/Test.php
And keep refreshing until it crashes.
My system is Win XP Pro with Apache 2 with PHP5RC1 (downloaded 3/24/04)

This application is an output from a Java->PHP translator. I believe it
started crashing a month ago (but it could be a feature I added). It's a bit
slow (takes ~.5 seconds on my computer) because of an OOP persistence layer.

Right now, I include a lineLog.html output to try to find where the crash
is, but it's not too helpful.

Thanks.


David Chen

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



Re: [PHP] Pre global configuration

2005-09-27 Thread Lendy Chen
$sendmail_path = @ini_get('sendmail_path');
if (!$sendmail_path)
{
// no sendmail, so we're using SMTP to send mail
$delimiter = "\r\n";
}
else
{
$delimiter = "\n";
}

in vBulletin

2005/9/27, Silvio Porcellana <[EMAIL PROTECTED]>:
> Jake Gardner wrote:
> > This is a stretch and I doubt you can do this very easily, but I was
> > wondering if there is a way to define behaviors that happen throughout
> > a script before execution for example if the OS is windows, all
> > strings are terminated with \r\n, if Linux, then \n without adding
> > addition ifs throughout the code.
> >
> I don't know if it may help you, but why don't you set a constant in a
> config file included by all your scripts to the CRLF value you want (if
> you want it dependant on the OS you can use http://php.net/php_uname)
> and then you append this constant to all your strings?
>
> Example:
>
> - config.inc.php:
> define('CRLF', ( strtoupper(substr(PHP_OS, 0, 3)) === 'WIN' ? "\r\n" :
> "\n" ) );
>
> - other_script.php
> require_once 'config.inc.php';
> 
> $string = 'Hi! My name is Pippo!' . CRLF;
>
>
> Or something like this... ;-)
>
> Cheers
> Silvio
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


--
Lendy Chen

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



Re: [PHP] Re: why does this not work?

2005-09-28 Thread Lendy Chen

if (screen.width<1064)
{
  document.write("<link src=\"style1.css\" type=\"text/css\"
rel=\"stylesheet\">");
}
else
{
  document.write("<link src=\"style2.css\" type=\"text/css\"
rel=\"stylesheet\">");
}


or use cookie, js write screen.width to cookie,then php read
screen.width from cookie.



2005/9/28, Oliver Grätz <[EMAIL PROTECTED]>:
> Ross schrieb:
> > $width = "  document.write(screen.width); ";
> > //$ross= intval($width);
>
> Yes, this is and will always be zero, because you are evaluating a
> string to an integer value.
>
> > echo $width;
> > if ($width < 1064) {
> > echo "lower";
> > $style= "style1.css";
> >
> > }
> > else {
> > $style= "style2.css";
> >
> > }
>
> OK, no I could insert the stuff about server side and client side.
> What you want to do is learn about the user's screen width. First of
> all, this is a bad idea if I you want to use it for design purposes like
> in this case where you include different CSS files. If I have a
> 1600x1200 screen, I can easily open a browser window at 640x480. And
> now? And even if you don't evaluate the screen width but the browser
> window's width: What about me resizing the already rendered page? Think
> about better designing the page so you don't need to switch the CSS...
>
> OK, enough of evangelism. If you really want to do what you told there:
> Evaluate the JavaScript on your entry page. Then do a redirect to that
> same page and insert the value into the URL (e.g.
> index.php?scrwidth=1280). You can then access this from PHP via $_GET.
> It is a good idea to store this value in the session once received so
> you don't have to send it around on each link.
>
>
> AllOLLi
>
>
> 
> 63,000 bugs in the code, 63,000 bugs,
> ya get 1 whacked with a service pack,
> now there's 63,005 bugs in the code!!
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


--
Lendy Chen

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



[PHP] Could you help me to solve this problem?

2005-12-04 Thread CHEN RAN

hi,

After uploading file to web server with php upload script in 
http://us3.php.net/features.file-upload, I can't access the file with web 
browser. I get error message as "403 Forbidden" or "You are not authorized 
to view this page".

However, there is no such problem when i using FTP to upload files.

Please help,

Thanks a lot.

Ran

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



Re: [PHP] AUTH_PW & External Authentication

2001-01-26 Thread Chen Shiyuan

On Fri, 26 Jan 2001 17:36:57 -0600, Richard Lynch <[EMAIL PROTECTED]> 
wrote :

> > I am currently using Apache-1.3.14 with php-4.0.4pl1 compiled
> statically
> > into it and running on RedHat Linux 6.2 . Apache is configured
> to do
> > authentication for certain URLs via a auth_ldap module which
> is
> > dynamically loaded when Apache starts.
> >
> > I noticed that when I access the protected URL, PHP_AUTH_PW
> will give me
> > the password for the user who is currently logged to the
> protected site.
> > If I recall correctly, earlier versions of PHP4 and PHP3 didn't
> have
> > this "feature" .
> 
> Hmm.  It was always there if PHP was doing the authentication --
> but I dunno
> if auth_ldap always had it.

errmm.. PHP wasn't doing the authentication. Basically I am using the 
basic Apache .htaccess authentication which calls auth_ldap to do 
authentication to a backend LDAP server. PHP is just used for "simple" 
website scripting and such.

previously when using earlier versions of PHP3 and PHP4 (can't really 
recall the versions number), I am quite certain PHP_AUTH_PW doesn't hold 
the user's password (under exactly the same configuration) as back then 
I was *trying* to find means and ways to get out the password so as to 
automate certain processess without the user having to enter the 
password multiple times but it was not successful. Only after upgrading 
to 4.0.3 then I noticed that PHP_AUTH_PW is now holding the user's 
password.

> Now, I could be grossly mistaken, but you're only seeing your own
> password,
> not somebody else's, right?...

yeap... i am seeing my own password.

> > This "feature" creates a problem when the protected URL is
> shared by
> > many parties with each party providing it's own services under
> the
> > protected URL as any party would be able to "steal" the
> > username/password without the end user knowing. The
> username/password is
> > used to control who has access to the protected URL and the
> parties are
> > not required to make use of the password.
> 
> Oh...  I'm not sure I follow this...  You're giving them access
> to a URL,
> using a password shared by a group somehow, but they don't
> actually know
> their own password?   How does the password get into the picture
> to start
> with?

errm not really. each person has his/her own username/password which is 
unique and personal to each person and is also used for other purposes.

The situation is that I have this main site which requires each person 
to "login" using their own username/password before gaining access so as 
to prevent unauthorised access to the site. And then within the site 
itself, there are different groups of developers (which may or may not 
be the same as the users, they can be outsiders too) which write their 
own programs for different purposes, i.e. forum, chatroom etc.

So the problem arises as these developers will be able to capture the 
password of the user who is accessing the program for good or for bad 
without the user knowing at all as the developer can just save the 
PHP_AUTH_USER and PHP_AUTH_PW into somewhere and this could constitute a 
security problem.

Erm... do you have any idea how to overcome this problem?

Many thanks in advance for your help!

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Uninitialized string offset

2002-07-05 Thread Uri Even-Chen

Hi,

Actually, the error_reporting is set to E_ALL and was set to E_ALL in
the previous version, too.  I found out they added the Uninitialized
string offset in Version 4.1.0 (see
<http://www.php.net/ChangeLog-4.php>).  I just wanted to know what this
error means.  Anyway, I think I'll just add a "@" sign to supporess
warnings.

Thanks!
Uri.


Chris Hewitt wrote:
> 
> Uri,
> 
> Sounds like the error reporting is set to E_ALL on the new php version
> and was set at a lower level before. The error indicates that the
> variable has not specfically been assigned a value before being used.
> 
> HTH
> Chris
> 
> Uri Even-Chen wrote:
> 
> >After upgrading to Red Hat Linux 7.3 (which also includes a new PHP
> >version), I saw this warning (Uninitialized string offset) on my apache
> >error log files. It refers to a line which was perfectly legal before:
> >
> >   if
> >(isset($GLOBALS['SPEEDY_GLOBAL_VARS']['CURRENT_USER']['UserName']))
> >
> >I always use isset to check if a variable is defined. Do you know why I
> >get this warning?



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




[PHP] suppressing errors with "@"

2002-07-05 Thread Uri Even-Chen

Hi,

I tried to suppress warnings in isset expressions (Uninitialized string
offset warnings).  The original line was something like this:

if (!(isset($GLOBALS['SPEEDY_GLOBAL_VARS']['PAGE_NAME'])))

When I added the "@" sign like this:

if (!(isset(@$GLOBALS['SPEEDY_GLOBAL_VARS']['PAGE_NAME'])))

My program stopped working, and I got errors like:

PHP Parse error:  parse error, expecting `T_VARIABLE' or `'$'' 

Eventually, I put the "@" in this place:

if (!(@isset($GLOBALS['SPEEDY_GLOBAL_VARS']['PAGE_NAME'])))

Which works, but why didn't it work the other way?  Is it some kind of
PHP bug?

I'm using PHP Version 4.1.2

Thanks,
Uri.


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




[PHP] Re: Uninitialized string offset

2002-07-06 Thread Uri Even-Chen

Thanks for the advice! I understand the problem now. I think they added
the Uninitialized
string offset in Version 4.1.0 (see
). That's why I didn't get this
warning before. Anyway, I think I'll just add a "@" sign to suppress
warnings. I tried it last nights and it works.

Uri.


Richard Lynch wrote:
> 
> >After upgrading to Red Hat Linux 7.3 (which also includes a new PHP
> >version), I saw this warning (Uninitialized string offset) on my apache
> >error log files. It refers to a line which was perfectly legal before:
> 
> The new settings in php.ini are error_reporting E_ALL by default.
> 
> Those errors have always been there, have always been generated, and you've
> been "ignoring" them.
> 
> >   if
> >(isset($GLOBALS['SPEEDY_GLOBAL_VARS']['CURRENT_USER']['UserName']))
> >
> >I always use isset to check if a variable is defined. Do you know why I
> >get this warning?
> 
> Best Guess:
> 
> PHP is only checking if the *LAST* array reference "isset" -- and to do
> that, *has* to assume that the others are there -- IE, that
> $GLOBALS['SPEEDY_GLOBAL_VARS']['CURRENT_USER'] is set...
> 
> Change it to this:
> 
> if (isset($GLOBALS['SPEEDY_GLOBAL_VARS'] &&
> $GLOBALS['SPEEDY_GLOBAL_VARS']['CURRENT_USER'] &&
> $GLOBALS['SPEEDY_GLOBAL_VARS']['CURRENT_USER']['UserName']){
> 
> --
> Like Music?  http://l-i-e.com/artists.htm



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




Re: [PHP] suppressing errors with "@"

2002-07-06 Thread Uri Even-Chen

Thanks! I also think it might be a bug. I reported it as a bug report.

Uri.


Miguel Cruz wrote:
> 
> On Sat, 6 Jul 2002, Uri Even-Chen wrote:
> > I tried to suppress warnings in isset expressions (Uninitialized string
> > offset warnings).  The original line was something like this:
> >
> > if (!(isset($GLOBALS['SPEEDY_GLOBAL_VARS']['PAGE_NAME'])))
> >
> > When I added the "@" sign like this:
> >
> > if (!(isset(@$GLOBALS['SPEEDY_GLOBAL_VARS']['PAGE_NAME'])))
> >
> > My program stopped working, and I got errors like:
> >
> > PHP Parse error:  parse error, expecting `T_VARIABLE' or `'$'' 
> >
> > Eventually, I put the "@" in this place:
> >
> > if (!(@isset($GLOBALS['SPEEDY_GLOBAL_VARS']['PAGE_NAME'])))
> >
> > Which works, but why didn't it work the other way?  Is it some kind of
> > PHP bug?
> 
> It does seem to be a disagreement with the manual:
> 
>http://www.php.net/manual/en/language.operators.errorcontrol.php
> 
> There it says that you can stick @ before a variable name.
> 
> miguel



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




[PHP] Undefined variables

2001-07-04 Thread Uri Even-Chen

To PHP-general group,


I have configured PHP to report all errors & warnings ("error_reporting
=   E_ALL" on php.ini file), but since then I get tons of warning
messages for "Undefined variables". For example, referring $HTTP_HOST
directly leads a message like "Undefined variable:  HTTP_HOST in ... on
line ...". I tried to use $HTTP_SERVER_VARS['HTTP_HOST'] instead, but
then I get the message "Undefined index:  HTTP_HOST in ... on line ...".
How do I get rid of these messages? I also get these messages for
internal variables, cookie variables (globals) etc.


I am also interested in testing whether the user typed the URL properly,
including upper/lower case. I'm using this code to check it in the
beginning of the page:

http://dating.speedy.co.il/');
   exit;
}
?>

But, if the user enters <http://DATING.SPEEDY.CO.IL/>, this has no
effect. Is there any way to get a case sensitive version of HTTP_HOST?
(I noticed HTTP_HOST has changed since the previous version of PHP &
apache).


Thanks,

Uri Even-Chen
Speedy Software
Raanana, Israel.

Welcome to Speedy Net (In Hebrew):
   http://www.speedy.co.il/
Speedy Dating (In Hebrew):
   http://dating.speedy.co.il/
Speedy Composer (In English):
   http://www.speedy.co.il/composer/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Always global variables

2001-07-09 Thread Uri Even-Chen

To PHP-general group,


Is there a way to define specific variables as "always global", without
needing to define them as global at each function separately?  For
example, these variables are always global on my scripts, so I have to
include this line in each function:


   // Global Variables.
   global $SPEEDY_GLOBAL_VARS, $HTTP_ENV_VARS, $HTTP_GET_VARS,
$HTTP_POST_VARS, $HTTP_COOKIE_VARS, $HTTP_SERVER_VARS;


Is there a way to define them only once globally?


Thanks,

Uri Even-Chen
Speedy Software
Raanana, Israel.

Welcome to Speedy Net (In Hebrew):
   http://www.speedy.co.il/
Speedy Dating (In Hebrew):
   http://dating.speedy.co.il/
Speedy Composer (In English):
   http://www.speedy.co.il/composer/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] PHP Conference in California

2001-07-10 Thread Uri Even-Chen

I have heard about the PHP Conference & O'Reilly Open Source Convention
in San Diego, California. Do you think it is worth being there? I saw
the prices and it's quite expensive. Not to mention the cost to get
there...

http://conferences.oreilly.com/oscon/


Thanks,

Uri Even-Chen
Speedy Software
Raanana, Israel.

Welcome to Speedy Net (In Hebrew):
   http://www.speedy.co.il/
Speedy Dating (In Hebrew):
   http://dating.speedy.co.il/
Speedy Composer (In English):
   http://www.speedy.co.il/composer/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] PHP Conference in California

2001-07-10 Thread Uri Even-Chen

Is it worth going there for the exhibit hall only? I am also interested
in the sessions & tutorials, but it looks quite expensive to participate
in them.

By the way, do you live in San Diego?

Uri.


Aaron Bennett wrote:
> 
> Well, exhibit hall is free... I'll be there.. of course, its only 10 minutes
> away. *grin*
> --
> Aaron
> 
> - Original Message -
> From: "Uri Even-Chen" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, July 10, 2001 9:11 AM
> Subject: [PHP] PHP Conference in California
> 
> > I have heard about the PHP Conference & O'Reilly Open Source Convention
> > in San Diego, California. Do you think it is worth being there? I saw
> > the prices and it's quite expensive. Not to mention the cost to get
> > there...
> >
> > http://conferences.oreilly.com/oscon/
> >
> >
> > Thanks,
> >
> > Uri Even-Chen
> > Speedy Software
> > Raanana, Israel.
> > 
> > Welcome to Speedy Net (In Hebrew):
> >http://www.speedy.co.il/
> > Speedy Dating (In Hebrew):
> >http://dating.speedy.co.il/
> > Speedy Composer (In English):
> >http://www.speedy.co.il/composer/
> > 
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] PHP Conference in California

2001-07-11 Thread Uri Even-Chen

Does it cost money to participate in the Microsoft vs RedHat Open Source
Debate and other events, or is the entrance free? I am also interested
in participating in this event. I would also like to participate in the
entire conference, but the prices are so high... Just the General
Conference Fee is $1095 (Early Bird Prices are over), and that's even
not including the tutorials. I am not a millionaire, And no company will
pay for me (I have my own business).

Uri.


Aaron Bennett wrote:
> 
> Well the exhibit hall is free... So if you're in town, and have a day or two
> sick-leave stored up, you might want to go...
> I'm still unclear if exhibit passes get you into any of the keynotes, but
> there will be a (heated) debate with MS sr. VP Craig Mundie and RedHat's
> Michael Tiemann...
> (http://conferences.oreillynet.com/cs/os2001/view/e_sess/1834)
> 
> Unless your company will spring for it, i'd skip the PHP seminar.. at $895,
> its no cheap vacation... I personally live in the area, and am just going to
> the exhibit.. I'd like to talk with those ActiveState and ArsDigita guys..
> I'd also like to see what Roadsend.com is doing with their PHP-SiteManager..
> (www.roadsend.com). Jabber.com is also going to be there, and (from what i
> hear) they're doing some stuff with XML exchanges...
> 
> --
> Aaron
> 
> - Original Message -
> From: "Uri Even-Chen" <[EMAIL PROTECTED]>
> To: "Aaron Bennett" <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Tuesday, July 10, 2001 2:43 PM
> Subject: Re: [PHP] PHP Conference in California
> 
> > Is it worth going there for the exhibit hall only? I am also interested
> > in the sessions & tutorials, but it looks quite expensive to participate
> > in them.
> >
> > By the way, do you live in San Diego?
> >
> > Uri.
> >
> >
> > Aaron Bennett wrote:
> > >
> > > Well, exhibit hall is free... I'll be there.. of course, its only 10
> minutes
> > > away. *grin*
> > > --
> > > Aaron
> > >
> > > - Original Message -
> > > From: "Uri Even-Chen" <[EMAIL PROTECTED]>
> > > To: <[EMAIL PROTECTED]>
> > > Sent: Tuesday, July 10, 2001 9:11 AM
> > > Subject: [PHP] PHP Conference in California
> > >
> > > > I have heard about the PHP Conference & O'Reilly Open Source
> Convention
> > > > in San Diego, California. Do you think it is worth being there? I saw
> > > > the prices and it's quite expensive. Not to mention the cost to get
> > > > there...
> > > >
> > > > http://conferences.oreilly.com/oscon/
> > > >
> > > >
> > > > Thanks,
> > > >
> > > > Uri Even-Chen
> > > > Speedy Software
> > > > Raanana, Israel.
> > > > 
> > > > Welcome to Speedy Net (In Hebrew):
> > > >http://www.speedy.co.il/
> > > > Speedy Dating (In Hebrew):
> > > >http://dating.speedy.co.il/
> > > > Speedy Composer (In English):
> > > >http://www.speedy.co.il/composer/
> > > > 
> > > >
> > > > --
> > > > PHP General Mailing List (http://www.php.net/)
> > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > > To contact the list administrators, e-mail:
> [EMAIL PROTECTED]
> > > >
> >

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] PHP Conference in California

2001-07-11 Thread Uri Even-Chen

It looks like the Microsoft vs RedHat Open Source Debate is part of the
summit
(http://conferences.oreillynet.com/cs/os2001/pub/w/os2001/sessions_summit.html),
in this case the price can be something around $1495 ($1295 if you have
already registered early). Looks like Mr. O'Reilly is going to make a
fortune!

Uri.

Uri Even-Chen
Speedy Software
Raanana, Israel.
E-mail: [EMAIL PROTECTED]
ICQ Number: 7461268
Phone Number: 09-7710730

Welcome to Speedy Net (In Hebrew):
   http://www.speedy.co.il/
Speedy Dating (In Hebrew):
   http://dating.speedy.co.il/
Speedy Composer (In English):
   http://www.speedy.co.il/composer/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] APC with horde/imp: 99.9% miss rate and only one cached file

2010-04-08 Thread Derek Chen-Becker
I suspect I've either done something horribly wrong or found a weird
bug, probably the former. I'm running PHP 5.2.13 on Solaris 10 under
Apache 2.2.14. Memory usage is 98.8% free (default 1 slice of 30MB).
Here are stats on the cache:

Cached Files1 (288.2 KBytes)
Hits4146
Misses  3579033
Request Rate (hits, misses) 358.68 cache requests/second
Hit Rate0.42 cache requests/second
Miss Rate   358.26 cache requests/second
Insert Rate 0.00 cache requests/second
Cache full count0

And here is my config in php.ini:

extension=apc.so
error_reporting = E_ALL ^ E_DEPRECATED
apc.report_autofilter = 1
log_errors = 1

If I restart apache, a different file gets cached each time (it rotates
between a very small subset of all of the PHP files in horde).
Sometimes, 2 or even 3 files get cached, but I've never had it go above
3. I've been googling around and reading the list archives but I can't
find anything that seems to be related to this. Am I misunderstanding
the purpose of APC? I thought that it would attempt to cache all PHP
files that are requested.

I turned on the report_autofilter in an attempt to diagnose the issue,
but nothing shows up in the error log. Here is the config as shown by
apc.php:

apc.cache_by_default1
apc.canonicalize1
apc.coredump_unmap  0
apc.enable_cli  0
apc.enabled 1
apc.file_md50
apc.file_update_protection  2
apc.filters 
apc.gc_ttl  3600
apc.include_once_override   0
apc.lazy_classes0
apc.lazy_functions  0
apc.max_file_size   1M
apc.mmap_file_mask  
apc.num_files_hint  1000
apc.preload_path
apc.report_autofilter   1
apc.rfc1867 0
apc.rfc1867_freq0
apc.rfc1867_nameAPC_UPLOAD_PROGRESS
apc.rfc1867_prefix  upload_
apc.rfc1867_ttl 3600
apc.shm_segments1
apc.shm_size30
apc.stat1
apc.stat_ctime  0
apc.ttl 0
apc.use_request_time1
apc.user_entries_hint   4096
apc.user_ttl0
apc.write_lock  1


Any help would be greatly appreciated.

Thanks,

Derek

-- 
--
Derek Chen-Becker
Senior Network Engineer, Security Architect
CPI Corp, Inc.
1706 Washington Ave
St. Louis, MO 63103
Phone: 314-231-7711 x6455
Fax:   314-613-6724
dbec...@cpicorp.com
PGP Key available from public key servers
Fingerprint: E4C4 26C0 8588 E80A C29F  636D 1FBE 0FE3 2871 4AE8
--

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



[PHP] Re: APC with horde/imp: 99.9% miss rate and only one cached file

2010-04-09 Thread Derek Chen-Becker
Well, downgrading APC from 3.1.3b1 to 3.0.19 fixed it. Working great now!

On 04/08/2010 02:21 PM, Derek Chen-Becker wrote:
> I suspect I've either done something horribly wrong or found a weird
> bug, probably the former. I'm running PHP 5.2.13 on Solaris 10 under
> Apache 2.2.14. Memory usage is 98.8% free (default 1 slice of 30MB).
> Here are stats on the cache:
> 
> Cached Files  1 (288.2 KBytes)
> Hits  4146
> Misses3579033
> Request Rate (hits, misses)   358.68 cache requests/second
> Hit Rate  0.42 cache requests/second
> Miss Rate 358.26 cache requests/second
> Insert Rate   0.00 cache requests/second
> Cache full count  0
> 
> And here is my config in php.ini:
> 
> extension=apc.so
> error_reporting = E_ALL ^ E_DEPRECATED
> apc.report_autofilter = 1
> log_errors = 1
> 
> If I restart apache, a different file gets cached each time (it rotates
> between a very small subset of all of the PHP files in horde).
> Sometimes, 2 or even 3 files get cached, but I've never had it go above
> 3. I've been googling around and reading the list archives but I can't
> find anything that seems to be related to this. Am I misunderstanding
> the purpose of APC? I thought that it would attempt to cache all PHP
> files that are requested.
> 
> I turned on the report_autofilter in an attempt to diagnose the issue,
> but nothing shows up in the error log. Here is the config as shown by
> apc.php:
> 
> apc.cache_by_default  1
> apc.canonicalize  1
> apc.coredump_unmap0
> apc.enable_cli0
> apc.enabled   1
> apc.file_md5  0
> apc.file_update_protection2
> apc.filters   
> apc.gc_ttl3600
> apc.include_once_override 0
> apc.lazy_classes  0
> apc.lazy_functions0
> apc.max_file_size 1M
> apc.mmap_file_mask
> apc.num_files_hint1000
> apc.preload_path  
> apc.report_autofilter 1
> apc.rfc1867   0
> apc.rfc1867_freq  0
> apc.rfc1867_name  APC_UPLOAD_PROGRESS
> apc.rfc1867_prefixupload_
> apc.rfc1867_ttl   3600
> apc.shm_segments  1
> apc.shm_size  30
> apc.stat  1
> apc.stat_ctime0
> apc.ttl   0
> apc.use_request_time  1
> apc.user_entries_hint 4096
> apc.user_ttl  0
> apc.write_lock1
> 
> 
> Any help would be greatly appreciated.
> 
> Thanks,
> 
> Derek
> 


-- 
--
Derek Chen-Becker
Senior Network Engineer, Security Architect
CPI Corp, Inc.
1706 Washington Ave
St. Louis, MO 63103
Phone: 314-231-7711 x6455
Fax:   314-613-6724
dbec...@cpicorp.com
PGP Key available from public key servers
Fingerprint: E4C4 26C0 8588 E80A C29F  636D 1FBE 0FE3 2871 4AE8
--

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