php-general Digest 7 Aug 2006 08:31:27 -0000 Issue 4279

Topics (messages 240203 through 240219):

Re: Using preg_match to find Japanese text
        240203 by: MOKULEN_IMADICA

Re: PHP Frameworks - Opinion
        240204 by: Martin Alterisio

Re: OT promotion & candidates needed
        240205 by: Ligaya Turmelle
        240206 by: John Meyer

looking for a short/simple kind of app...
        240207 by: bruce

Re: Newbie Form Question
        240208 by: David Dorward

How to install PHP 4 on Apache 2.2
        240209 by: Ko Ko
        240213 by: Chris

Re: Image list performance ISSUE
        240210 by: Andy
        240211 by: Chris

shebang line drive me nuts.
        240212 by: Jochem Maas
        240214 by: Robert Cummings
        240215 by: Jochem Maas
        240216 by: Stut
        240217 by: Jochem Maas
        240218 by: Chris
        240219 by: Jochem Maas

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        php-general@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
Dear all and Dave,

>I want to divide the first line into three variables, $word, $reading, 
>and $meaning. And I want to divide the second line into two variables, 
>$word and $meaning.

What you(Dave) want seems to have some resemblance to 
what I tackled in last month.I tried to sort out some japanese
characters which can input to my server but cannot be displayed
correctly in japanese-main-portable-phone-browsers through my poor
program.

>The following contains UTF-8 encoded Japanese text. 

If you specify EUC-JP in [mbstring] of "php.ini"
(this is usual way when using Japanese character in PHP),
 I propose first to change that into Shift-JIS to solve this problem.
Probably, you specify UTF-8 in charaset in your ".php"s.
I propose to change it into SHIFT-JIS.

As far as I executed, it is difficult to extract the specific japanese
word.

I think that you should add the processing which replaces a Japanese
word with the other language ( English ) once in your server.

In my case,I first made the list of the words which aren't displayed
correctly in main-japanese-portable-phone-browsers through my poor
program.Then, I checked a "non-displayed-word" on the list and programed
to sort out a "non-displayed-word" (,and replace a "non-displayed-word"
to a image).

What I wrote above is probably not the advice which you(Dave) demand.
I do not see linkpages in your e-mail yet.I am sorry of my poor advice.
Anway,I send this to you.

Thank you for being interested in Japanese.>Dave

Thank you for developing [mbstring] in php.ini. >developers.
.
Madoca

Attachment: signature.asc
Description: このメッセー ジにはデジタ ル署名された 部分がありま す


--- End Message ---
--- Begin Message ---
2006/8/4, Manuel Lemos <[EMAIL PROTECTED]>:

Hello,

on 08/03/2006 05:18 PM Martin Alterisio said the following:
>> Anyway, you may want to read this more in depth reflection of the state
>> of the PHP framework world and recommendations on how to pick what
suits
>> best for you:
>>
>> http://www.phpclasses.org/blog/post/52-Recommended-PHP-frameworks.html
>
>
> Sorry to intrude with my usual obnoxious behaviour, but this is starting
to
> affect my self-esteem (what's left of it). Am I the only one who has a
> really hard time reading the blog posts in phpclasses.org? Everytime a
> reference to this blog is posted I lose track of the discussion, because
I
> can't really grasp what Lemos is talking about.
>
> I'd like to make some some constructive criticism, not just to Lemos but
to
> the community in general, since I think many of us need to improve our
> writing skills:
>
> 1 - Don't make loooong boooring posts.

This blog in reality is the site monthly announcement newsletter. Some
months there is more to tell than in others. I usually put a list of
contents when the post is about many subjects.


Then maybe you should consider making it a _weekly_ announcement newsletter,
'cause some of those posts are really really too long to digest in only one
shot.

2 - Get to the point. Introduction are great when they are not two pages
> long.

I don't know what you mean by introduction. Usually there is a summary
that goes in the RSS feed that is no longer than 3 or 4 paragraphs.


I mean all the things you need to say before actually getting into what you
want to talk about. Just take for example the post about "recommend php
framework", look how much you have to read before actually get any info
relating directly to php frameworks. Is true that there are many things to
say before about frameworks hype, but couldn't it be explained in less
words?

3 - Stick to the topic. Or use appropiate titles.

> 4 - If the topic is inherently long, use distinguishable headers and
> subheaders. It's a pain in the ass to read a 5 pages long article that
> looks
> the same everywhere, with no easy way to know what is the subtopic of
what
> are you reading now.

As I said, these posts often cover many topics. It may not seem by topic
sections use titles. The problem is that this newsletter posts used to
go by e-mail to the site subscribers in plain text, so there was no way
to format titles.


I was unaware of that, I understand now. It's really a pain in the ass to
format a text only email for proper reading.... even more if the same text
has to be used in a website.

Anyway, now that you mentioned it I applied an additional regular
expression to add title formatting when presenting it in the site. Just
let me know if it looks ok now.


Yeah, I saw that. I believe it's a little bit better now.

5 - Don't talk so much about your life! You can always make another blog
> for
> that... Unless your personal experience can bring an unique insight of
the
> point you're trying to make.

I suppose you may be talking about other peoples blogs. Personal blogs
are supposed to be personal. This is the PHPClasses site blog. Usually
it covers matters about the site developments and matters of interest to
the site users. It does not talk about my life. It may talk about my
experience when it is relevant to the post topic.


Generally speaking, yes, I'm talking about other peoples blogs. I'm sick
tired of all the holy crusades out there, specially when it comes to
Web2.0evangelists. You may have not noticed it but somewhere here or
there you let
your subconcious write for you, specially on the topic of Web2.0 (I used the
term twice already, please stop me before I have to pay royalties to
O'reilly). It may be just an adjective, but that's all it takes to make a
mildly objetive point of view turn into a completely subjective point of
view.

Just check your article about "is php ready for ..." *that thing I said
before*, and you'll see that how, without noticing it, personal feelings
tend to appear and change the article completely. Probably that's what made
you write so much about how you believe phpclasses.org is a *that term*
enabled site, and why. Was all that really necesary for the purpose of the
article? Or you were just uncounciously trying to prove something to all
those lamers out there? Does it really matter if your site is "in" or "out"?
We are not fashion designers...

--- End Message ---
--- Begin Message ---
Jay Blanchard wrote:
Good news/kinda' bad news (but not really); I am proud to say that I
have been promoted to Director of IT in my little corner of the world.

Congrats on the promotion - Love the pretty title. Does it come with letters even? ;)


--

life is a game... so have fun.

--- End Message ---
--- Begin Message ---
Director, nah.  Wait until you are promoted to Dictator of IT.  That's where 
the real power begins.  BWAHAHAHAHAH...cough.

Enough maniacal laughing for now, back to work.

-----Original Message-----
From: Ligaya Turmelle [mailto:[EMAIL PROTECTED] 
Sent: Sunday, August 06, 2006 7:16 PM
To: Jay Blanchard
Cc: [php] PHP General List
Subject: Re: [PHP] OT promotion & candidates needed

Jay Blanchard wrote:
> Good news/kinda' bad news (but not really); I am proud to say that I 
> have been promoted to Director of IT in my little corner of the world.

Congrats on the promotion - Love the pretty title.  Does it come with letters 
even? ;)


-- 

life is a game... so have fun.

--- End Message ---
--- Begin Message ---
hi...

i'm looking for a short/simple kind of app to allow me to play around with
some different tbls..

basically.. i have a couple of tbls where i have a top level tbls, and a few
subordinate child tbls

 parent
   child
     child

i'd like to be able to add/modify/delete items from the various tbls.. i'd
also like to be able to display a kind of breadcrumb across the top of the
page allowing me to get back to the selected item/tbl...

i'm willing to bet that there are numerous examples of this kind of app. i'm
simply hoping that someone can point me to one that i can play around
with...

thanks

-bruce

--- End Message ---
--- Begin Message ---
Richard Lynch wrote:

> <?php
>   if (isset($_REQUEST['email'])){
>     $success = mail($_REQUEST['action'], 'un/subscribe',
> 'un/subscribe', "From: $_REQUEST[email]\r\nReply-to:
> $_REQUEST[email]");
>     if ($success) echo "Status Change Sent";
>     else echo "Unable to send Status Change";
>   }
> ?>

What if someone submitted:

action = [EMAIL PROTECTED]

email = [EMAIL PROTECTED] long winded evil spam message here

?

-- 
David Dorward       <http://blog.dorward.me.uk/>   <http://dorward.me.uk/>
                     Home is where the ~/.bashrc is

--- End Message ---
--- Begin Message ---
Hi,
   
  I have Apache 2.2 and PHP 5 on Fedora 5. And since I am writing a lot of my 
php code which is only compatible with PHP 4 I remove the PHP 5 rpm and 
installed the PHP 4. But I notice that Apache 2.2 doesn't recognize PHP 4 right 
away. I can't find out on the net how to tweak the system to recognize PHP 4. 
Can anyone help me?
   
  Regards,
   
  Leo



Reality starts with Dream 

                        
---------------------------------
See the all-new, redesigned Yahoo.com.  Check it out.

--- End Message ---
--- Begin Message ---
Ko Ko wrote:
Hi,
I have Apache 2.2 and PHP 5 on Fedora 5. And since I am writing a lot of my php code which is only compatible with PHP 4 I remove the PHP 5 rpm and installed the PHP 4. But I notice that Apache 2.2 doesn't recognize PHP 4 right away. I can't find out on the net how to tweak the system to recognize PHP 4. Can anyone help me?

No particular "tweaks" necessary.

Guess you didn't search too hard, the first item in search results for "php4 apache2" was this page:

http://dan.drydog.com/apache2php.html


--
Postgresql & php tutorials
http://www.designmagick.com/

--- End Message ---
--- Begin Message ---
Sorry for the late answer,

I have different applications and the users are kept in DB so I cannot make for every user a directory. I made a solution with .htaccess from apache and redirection to a php script that outputs the image if the user has rights to the images.

I will still have to check the performance of the system in this case, but I think it will be the same.

The performance Issue that I asked was:
Is there a difference if apache sends the image or If I output it with php with readfile.

Andy.


----- Original Message ----- From: "WeberSites LTD" <[EMAIL PROTECTED]>
To: "'Andy'" <[EMAIL PROTECTED]>; <php-general@lists.php.net>
Sent: Thursday, August 03, 2006 9:32 PM
Subject: RE: [PHP] Image list performance ISSUE


Why don't you name the images with the GUID of the user?
I want to see someone try to guess another user's GUID...

-----Original Message-----
From: Andy [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 02, 2006 11:16 AM
To: php-general@lists.php.net
Subject: [PHP] Image list performance ISSUE

Hi,

I have tons of images, which belongs to different users. In the software we show to the users only the images that they have, but If they take the image
links manually they can also see the other images if they modify the image
name in the link.

Now, I can override the image request with apache rewrite and send the
request to a php file, which analizes the user rights and if the user has
rights to see that image. After that I output the image file with php this
way:
           header("Content-Type: image/jpeg");
           header("Content-Length: ".filesize($fname));
           readfile($fname);

... where fname is the image file.

I want to know... is this a big performance issue or not(the image is
handled by php and not by apache directly)

OR...

Is there any other way to handle this situation???

Thanx,
Andy.




--- End Message ---
--- Begin Message ---
Andy wrote:
Sorry for the late answer,

I have different applications and the users are kept in DB so I cannot make for every user a directory. I made a solution with .htaccess from apache and redirection to a php script that outputs the image if the user has rights to the images.

I will still have to check the performance of the system in this case, but I think it will be the same.

The performance Issue that I asked was:
Is there a difference if apache sends the image or If I output it with php with readfile.

Yes there will be a difference.

If apache sends the image, it just does:

- is the path valid?
- send it.

If you use readfile, apache has to fire up php, process the php script which then sends the image (which means another handle to read the file and so on), so there is a big difference between the two.

Depending on how busy your server is, it may or may not be measurable but there is a big difference in terms of processing.

--
Postgresql & php tutorials
http://www.designmagick.com/

--- End Message ---
--- Begin Message ---
I have a php shell script (the execute bit of the file is set)
of which the first line is this:

#!/usr/lib/php5/bin/php -q

or this:

#!/usr/bin/php -q

or this:

#!php -q


in all cases I get the following error when I run (as root) the script:

-bash: ./makemicrositeml: /usr/lib/php5/bin/php: bad interpreter: Permission 
denied


php is where I think it is:

# which php
/usr/bin/php
# ls -lart /usr/bin/php
lrwxrwxrwx 1 root root 21 May  9 11:40 /usr/bin/php -> /usr/lib/php5/bin/php

any know what idiot thing I'm doing wrong?
cheers.

--- End Message ---
--- Begin Message ---
On Mon, 2006-08-07 at 09:59 +0200, Jochem Maas wrote:
> I have a php shell script (the execute bit of the file is set)
> of which the first line is this:
> 
> #!/usr/lib/php5/bin/php -q
> 
> or this:
> 
> #!/usr/bin/php -q
> 
> or this:
> 
> #!php -q
> 
> 
> in all cases I get the following error when I run (as root) the script:
> 
> -bash: ./makemicrositeml: /usr/lib/php5/bin/php: bad interpreter: Permission 
> denied
> 
> 
> php is where I think it is:
> 
> # which php
> /usr/bin/php
> # ls -lart /usr/bin/php
> lrwxrwxrwx 1 root root 21 May  9 11:40 /usr/bin/php -> /usr/lib/php5/bin/php
> 
> any know what idiot thing I'm doing wrong?

Check the permissions on /usr/lib/php5 and on /usr/lib/php5/bin and
on /usr/lib/php5/bin/php

Any one of those being set incorrectly can deny you access.

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

--- End Message ---
--- Begin Message ---
hi Chris,

Chris wrote:
> Jochem Maas wrote:
>> I have a php shell script (the execute bit of the file is set)
>> of which the first line is this:
>>
>> #!/usr/lib/php5/bin/php -q
>>
>> or this:
>>
>> #!/usr/bin/php -q
>>
>> or this:
>>
>> #!php -q
>>
>>
>> in all cases I get the following error when I run (as root) the script:
>>
>> -bash: ./makemicrositeml: /usr/lib/php5/bin/php: bad interpreter:
>> Permission denied
>>
>>
>> php is where I think it is:
>>
>> # which php
>> /usr/bin/php
>> # ls -lart /usr/bin/php
>> lrwxrwxrwx 1 root root 21 May  9 11:40 /usr/bin/php ->
>> /usr/lib/php5/bin/php
> 
> 3 things to check:
> 
> - /usr/lib/php5/bin/php exists
> - /usr/lib/php5/bin/php is executable
> - your script is executable.

these I had checked already - I didn't make that clear, sorry.

> 
> 
> If you run:
> 
> /usr/lib/php5/bin/php -q /path/to/your/script.php
> 
> does it work?

yup that works fine.
weird huh!

> 

--- End Message ---
--- Begin Message ---
Jochem Maas wrote:
I have a php shell script (the execute bit of the file is set)
of which the first line is this:

#!/usr/lib/php5/bin/php -q

or this:

#!/usr/bin/php -q

or this:

#!php -q


in all cases I get the following error when I run (as root) the script:

-bash: ./makemicrositeml: /usr/lib/php5/bin/php: bad interpreter: Permission 
denied


php is where I think it is:

# which php
/usr/bin/php
# ls -lart /usr/bin/php
lrwxrwxrwx 1 root root 21 May  9 11:40 /usr/bin/php -> /usr/lib/php5/bin/php

any know what idiot thing I'm doing wrong?

This can happen if the line ending in the script are DOS not UNIX - have you been editing the file on Windows and then uploading it? Easiest way to check is to open the file with vi and check for ^M on the end of the lines. If it's there, remove it from the first line and try again.

-Stut

--- End Message ---
--- Begin Message ---
hi Stut,

I wish it was the line endings - I checked and they where unix-style.
I do edit on windows normally (unless it's some rush fix and then I'll
use vi or nano) but I have the line-endings set to unix.

vi gave no sign of a ^M and I rewrote the shebang there just to be
safe.

alas no joy.

Stut wrote:
> Jochem Maas wrote:
>> I have a php shell script (the execute bit of the file is set)
>> of which the first line is this:
>>
>> #!/usr/lib/php5/bin/php -q
>>
>> or this:
>>
>> #!/usr/bin/php -q
>>
>> or this:
>>
>> #!php -q
>>
>>
>> in all cases I get the following error when I run (as root) the script:
>>
>> -bash: ./makemicrositeml: /usr/lib/php5/bin/php: bad interpreter:
>> Permission denied
>>
>>
>> php is where I think it is:
>>
>> # which php
>> /usr/bin/php
>> # ls -lart /usr/bin/php
>> lrwxrwxrwx 1 root root 21 May  9 11:40 /usr/bin/php ->
>> /usr/lib/php5/bin/php
>>
>> any know what idiot thing I'm doing wrong?
> 
> This can happen if the line ending in the script are DOS not UNIX - have
> you been editing the file on Windows and then uploading it? Easiest way
> to check is to open the file with vi and check for ^M on the end of the
> lines. If it's there, remove it from the first line and try again.
> 
> -Stut

--- End Message ---
--- Begin Message ---
Jochem Maas wrote:
I have a php shell script (the execute bit of the file is set)
of which the first line is this:

#!/usr/lib/php5/bin/php -q

or this:

#!/usr/bin/php -q

or this:

#!php -q


in all cases I get the following error when I run (as root) the script:

-bash: ./makemicrositeml: /usr/lib/php5/bin/php: bad interpreter: Permission 
denied


php is where I think it is:

# which php
/usr/bin/php
# ls -lart /usr/bin/php
lrwxrwxrwx 1 root root 21 May  9 11:40 /usr/bin/php -> /usr/lib/php5/bin/php

3 things to check:

- /usr/lib/php5/bin/php exists
- /usr/lib/php5/bin/php is executable
- your script is executable.


If you run:

/usr/lib/php5/bin/php -q /path/to/your/script.php

does it work?

--
Postgresql & php tutorials
http://www.designmagick.com/

--- End Message ---
--- Begin Message ---
hi Robert,

thanks for thinking with me ....

Robert Cummings wrote:
> On Mon, 2006-08-07 at 09:59 +0200, Jochem Maas wrote:
>> I have a php shell script (the execute bit of the file is set)
>> of which the first line is this:
>>
>> #!/usr/lib/php5/bin/php -q
>>
>> or this:
>>
>> #!/usr/bin/php -q
>>
>> or this:
>>
>> #!php -q
>>
>>
>> in all cases I get the following error when I run (as root) the script:
>>
>> -bash: ./makemicrositeml: /usr/lib/php5/bin/php: bad interpreter: Permission 
>> denied
>>
>>
>> php is where I think it is:
>>
>> # which php
>> /usr/bin/php
>> # ls -lart /usr/bin/php
>> lrwxrwxrwx 1 root root 21 May  9 11:40 /usr/bin/php -> /usr/lib/php5/bin/php
>>
>> any know what idiot thing I'm doing wrong?
> 
> Check the permissions on /usr/lib/php5 and on /usr/lib/php5/bin and
> on /usr/lib/php5/bin/php
> 
> Any one of those being set incorrectly can deny you access.

the php binary is executable for everyone:

 # ls -lart /usr/lib/php5/bin/php
-rwxr-xr-x 1 root root 7012544 Jul  5 18:26 /usr/lib/php5/bin/php

and running the script as follows doesn't give any errors:

# /usr/lib/php5/bin/php -q ./makemicrositeml -h

(it shows the help message - I haven't got round to exactly testing the
script proper ;-)

any ideas>

> 
> Cheers,
> Rob.

--- End Message ---

Reply via email to