php-general Digest 6 Dec 2003 12:54:36 -0000 Issue 2457

Topics (messages 172032 through 172054):

Maximum execution time
        172032 by: John J Foerch
        172033 by: Pablo Gosse
        172038 by: James Hicks

Re: Spamming bastardly problem, please help
        172034 by: John Nichel
        172035 by: Vail, Warren
        172036 by: Vail, Warren
        172037 by: John Nichel
        172039 by: John Nichel
        172040 by: Ajai Khattri
        172044 by: Ryan A

Whitespace filter
        172041 by: Justin Hendrickson
        172042 by: Chris W. Parker
        172043 by: John Coggeshall

Re: Not able to execute Linux binary
        172045 by: Karam Chand

count()
        172046 by: Anthony Ritter

Re: Invalid library (maybe not a PHP library)
        172047 by: Anas Mughal
        172049 by: Anas Mughal
        172050 by: Anas Mughal

UIEE?
        172048 by: Leif K-Brooks

Re: converting string into array with regex
        172051 by: Adam i Agnieszka Gasiorowski FNORD

Re: Apache 2 + PHP
        172052 by: Seung Hwan Kang

Re: PHP RSS sites and SlashDot
        172053 by: Burhan Khalid

Can't exec() a program that uses mem alloc?
        172054 by: Iain Staffell

Administrivia:

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

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

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
Hi,
     Is there some way to turn off maximum execution time?  Preferably
within the script itself?
Thanks,
John

--- End Message ---
--- Begin Message ---
John J Foerch wrote:
> Hi,
>      Is there some way to turn off maximum execution time? 
> Preferably within the script itself? Thanks, John 

ini_set('max_execution_time',0);

--- End Message ---
--- Begin Message ---
On Friday 05 December 2003 05:22 pm, John J Foerch wrote:
> Hi,
>      Is there some way to turn off maximum execution time?  Preferably
> within the script itself?
> Thanks,
> John

set_time_limit(0);

zero is for not timeout, change to # of seconds if you want.

James

--- End Message ---
--- Begin Message --- Ryan A wrote:

Hi,
Some son of a ***** is spamming people and using one or our websites as a
return address, so all the emails that get bounced are coming right back to
us, as you can imagine thats quite a lot, plus we are getting angry people
writing to us.

I had a look at the emails and I see its the usual crap: viagra,
prescription meds and getting collage degrees etc

What can I do about it? complaining to the sites that the spam is promoting
is stupid since they are using this method to promote their crap....

Problem is we have a catch all address as the site is large and we have been
using differient email ids all around the place which basically goes into
one, so turning of the catch all can/would result in us missing some
important stuff...

ANY ideas?

Thanks,
-Ryan


Same problem with my by-tor.com domain. First thing I checked was to make sure that I wasn't an open relay...make sure the spammers aren't using your mail server. Most of the headers are forged, so tracking them down is almost impossible. And if you complain to the site that these emails are linking too, they'll just say it's not them, but someone in an affiliate program...they might even tell you that they banned that user, but can't do anything about them sending the emails. Basically, there's not much you can do save reply nicely to the people who've come to you because they got spammed.


--
By-Tor.com
It's all about the Rush
http://www.by-tor.com

--- End Message ---
--- Begin Message ---
http://spamassassin.org/index.html

you might also try filtering on the body looking for a common phrase.  Spam
assassin looks for phrases like "you opted" and instructions on how to stop
receiving these emails, a single source will often use the same opt out
phrase.

hang in there, you can lick this

Warren

-----Original Message-----
From: Eric Bolikowski [mailto:[EMAIL PROTECTED]
Sent: Friday, December 05, 2003 2:27 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: Spamming bastardly problem, please help


"Ryan A" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
> Some son of a ***** is spamming people and using one or our websites as a
> return address, so all the emails that get bounced are coming right back
to
> us, as you can imagine thats quite a lot, plus we are getting angry people
> writing to us.
>
> I had a look at the emails and I see its the usual crap: viagra,
> prescription meds and getting collage degrees etc
>
> What can I do about it? complaining to the sites that the spam is
promoting
> is stupid since they are using this method to promote their crap....
>
> Problem is we have a catch all address as the site is large and we have
been
> using differient email ids all around the place which basically goes into
> one, so turning of the catch all can/would result in us missing some
> important stuff...
>
> ANY ideas?
>
> Thanks,
> -Ryan

have you checked ALL possible information in the mail headers for some info?

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

--- End Message ---
--- Begin Message ---
Did you get the following;

---------------<snip>--------------------------------
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Friday, December 05, 2003 2:32 PM
To: Vail, Warren
Subject: Mail rejected


I'm sorry but your email with subject SPAMWARNING:RE: [PHP] Re: Spamming
bastardly problem, please help addressed to "'Eric Bolikowski'"
<[EMAIL PROTECTED]>, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
could not be delivered because forbidden keyword viagra
----------------<snip>------------------------------

-----Original Message-----
From: Vail, Warren 
Sent: Friday, December 05, 2003 2:32 PM
To: 'Eric Bolikowski'; [EMAIL PROTECTED]
Subject: RE: [PHP] Re: Spamming bastardly problem, please help


http://spamassassin.org/index.html

you might also try filtering on the body looking for a common phrase.  Spam
assassin looks for phrases like "you opted" and instructions on how to stop
receiving these emails, a single source will often use the same opt out
phrase.

hang in there, you can lick this

Warren

-----Original Message-----
From: Eric Bolikowski [mailto:[EMAIL PROTECTED]
Sent: Friday, December 05, 2003 2:27 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: Spamming bastardly problem, please help


"Ryan A" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
> Some son of a ***** is spamming people and using one or our websites as a
> return address, so all the emails that get bounced are coming right back
to
> us, as you can imagine thats quite a lot, plus we are getting angry people
> writing to us.
>
> I had a look at the emails and I see its the usual crap: viagra,
> prescription meds and getting collage degrees etc
>
> What can I do about it? complaining to the sites that the spam is
promoting
> is stupid since they are using this method to promote their crap....
>
> Problem is we have a catch all address as the site is large and we have
been
> using differient email ids all around the place which basically goes into
> one, so turning of the catch all can/would result in us missing some
> important stuff...
>
> ANY ideas?
>
> Thanks,
> -Ryan

have you checked ALL possible information in the mail headers for some info?

-- 
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

--- End Message ---
--- Begin Message --- Vail, Warren wrote:

http://spamassassin.org/index.html

you might also try filtering on the body looking for a common phrase.  Spam
assassin looks for phrases like "you opted" and instructions on how to stop
receiving these emails, a single source will often use the same opt out
phrase.

hang in there, you can lick this

Warren
<snip>

He's not receiving spam from these places...these places are putting his domain in the sender address of the spam they're sending out.

--
By-Tor.com
It's all about the Rush
http://www.by-tor.com

--- End Message ---
--- Begin Message --- Now this is funny....can't reply to Ryan's email without editing the original message because he said ****** (that male enhancement pill).

[EMAIL PROTECTED] wrote:
> I'm sorry but your email with subject SPAMWARNING:Re: [PHP] Spamming >
> bastardly problem, please help addressed to "Ryan A" > > >
> <[EMAIL PROTECTED]> could not be delivered because forbidden keyword
> viagra
>

--
By-Tor.com
It's all about the Rush
http://www.by-tor.com

--- End Message ---
--- Begin Message ---
On Fri, Dec 05, 2003 at 11:03:56PM +0100, Ryan A wrote:

> Problem is we have a catch all address as the site is large and we have been
> using differient email ids all around the place which basically goes into
> one, so turning of the catch all can/would result in us missing some
> important stuff...

Your basic problem is there - you have a catchall. This is like having a
"bury-me-spam-free-n-easy" card.

I say grab the bull by the horns: make a list of all possible email addresses
and set them up, then remove the catchall. Worst-case is that you miss a few
here and there and have to re-create them as aliases.

-- 
Aj.
Sys. Admin / Developer

--- End Message ---
--- Begin Message ---
Hey guys,
Thanks for your suggestions, will look into it but
1.I dont think just closing the catch all will solve the problem
2.Yep, checked if I had an open relay immediately, thats secure, its not
being relayed from me
3.Yep, am answering all emails politely and explaining to the people who are
writing to me
4.Got in touch with my ISP and told them whats happening and that we *are
not* the ones doing this crap.
5.I filtered the messages and I see that they are already blacklisted by
spamcop, my sites IP and I are thankfully
not.

I guess the stupid SOBs thought we are behind an anonymous proxy or
something because of the nature of the site (http://www.noCme.com)

Damn, that V****a word is so badly blacklisted I'm pretty sure I must have
not recieved some emails from pals that contained jokes with that word in
it... :-(

Lets all hope that spammers get leprosy and their main body parts fall off,
if enough of us hope and think strong enough maybe our wish will come true
:-)

Cheers all,
-Ryan

http://Bestwebhosters.com


----- Original Message ----- 
From: "John Nichel" <[EMAIL PROTECTED]>
To: "Ryan A" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, December 05, 2003 11:33 PM
Subject: Re: [PHP] Spamming bastardly problem, please help


> Ryan A wrote:
>
> > Hi,
> > Some son of a ***** is spamming people and using one or our websites as
a
> > return address, so all the emails that get bounced are coming right back
to
> > us, as you can imagine thats quite a lot, plus we are getting angry
people
> > writing to us.
> >
> > I had a look at the emails and I see its the usual crap: viagra,
> > prescription meds and getting collage degrees etc
> >
> > What can I do about it? complaining to the sites that the spam is
promoting
> > is stupid since they are using this method to promote their crap....
> >
> > Problem is we have a catch all address as the site is large and we have
been
> > using differient email ids all around the place which basically goes
into
> > one, so turning of the catch all can/would result in us missing some
> > important stuff...
> >
> > ANY ideas?
> >
> > Thanks,
> > -Ryan
> >
>
> Same problem with my by-tor.com domain.  First thing I checked was to
> make sure that I wasn't an open relay...make sure the spammers aren't
> using your mail server.  Most of the headers are forged, so tracking
> them down is almost impossible.  And if you complain to the site that
> these emails are linking too, they'll just say it's not them, but
> someone in an affiliate program...they might even tell you that they
> banned that user, but can't do anything about them sending the emails.
> Basically, there's not much you can do save reply nicely to the people
> who've come to you because they got spammed.
>
> -- 
> By-Tor.com
> It's all about the Rush
> http://www.by-tor.com
>
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>

--- End Message ---
--- Begin Message --- Does anyone have an eloquent way to strip redundant whitespace without harming whitespace inside <pre>, <textarea> or <script> tags? I'd like to post-filter my HTML before returning it to the client and I'm not all that great with regular expressions.
--- End Message ---
--- Begin Message ---
Justin Hendrickson <mailto:[EMAIL PROTECTED]>
    on Friday, December 05, 2003 5:51 AM said:

> Does anyone have an eloquent way to strip redundant whitespace without
> harming whitespace inside <pre>, <textarea> or <script> tags? I'd like
> to post-filter my HTML before returning it to the client and I'm not
> all that great with regular expressions.

If it's just white space on the ends of the text you can use trim(). As
for a regular expression...

/\s{2,}|\t/ /

Will replace 2 or more whitespace characters (tab, space) with just one
space as well as replacing one tab character \t with one space. That
works in Perl (me thinks), but you'll have to fenagle it to work with
ereg_replace() in PHP.

Note, thiw will also rip through <pre>, <textarea>, and any other tag.
It will apply to the entire string you supply it with. Unless you have
gobs of white space in your HTML there's really no point in getting rid
of it since all browsers will only display one space even if they
encounter multiple spaces. For example:

HTML:

This      is    my  HTML.

Will display as...

This is my HTML.

...in any browser.


Chris.

p.s. My regex is fairly weak so there could very well be a better one
for this.
--
Don't like reformatting your Outlook replies? Now there's relief!
http://home.in.tum.de/~jain/software/outlook-quotefix/

--- End Message ---
--- Begin Message ---
You can also use the tidy extension.

http://pecl.php.net/package-info.php?package=tidy

John

On Fri, 2003-12-05 at 20:23, Chris W. Parker wrote:
> Justin Hendrickson <mailto:[EMAIL PROTECTED]>
>     on Friday, December 05, 2003 5:51 AM said:
> 
> > Does anyone have an eloquent way to strip redundant whitespace without
> > harming whitespace inside <pre>, <textarea> or <script> tags? I'd like
> > to post-filter my HTML before returning it to the client and I'm not
> > all that great with regular expressions.
> 
> If it's just white space on the ends of the text you can use trim(). As
> for a regular expression...
> 
> /\s{2,}|\t/ /
> 
> Will replace 2 or more whitespace characters (tab, space) with just one
> space as well as replacing one tab character \t with one space. That
> works in Perl (me thinks), but you'll have to fenagle it to work with
> ereg_replace() in PHP.
> 
> Note, thiw will also rip through <pre>, <textarea>, and any other tag.
> It will apply to the entire string you supply it with. Unless you have
> gobs of white space in your HTML there's really no point in getting rid
> of it since all browsers will only display one space even if they
> encounter multiple spaces. For example:
> 
> HTML:
> 
> This      is    my  HTML.
> 
> Will display as...
> 
> This is my HTML.
> 
> ...in any browser.
> 
> 
> Chris.
> 
> p.s. My regex is fairly weak so there could very well be a better one
> for this.
> --
> Don't like reformatting your Outlook replies? Now there's relief!
> http://home.in.tum.de/~jain/software/outlook-quotefix/
-- 
-=~=--=~=--=~=--=~=--=~=--=~=--=~=--=~=--=~=--=~=--=~=--=~=-
John Coggeshall                   http://www.coggeshall.org/
The PHP Developer's Handbook    http://www.php-handbook.com/
-=~=--=~=--=~=--=~=--=~=--=~=--=~=--=~=--=~=--=~=--=~=--=~=-

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

looking at manuals and help and some help from you. i
wrote the attached code-

  error_reporting (E_ALL);
  ini_set('display_errors', 1);

  $result = `./myapp`;
  print_r ( $result );

  echo ( "2" );

  exec("./myapp",$result);
  print_r($result);

It is returning output

2Array ( ) 

which means the array is empty !!!

it should have outputted ErrorError

Both the php and the binary exsits in
http://www.mydomain.com/mgmt/

Can I send you the binary so that you can check it
out?

Karam

--- Jason Wong <[EMAIL PROTECTED]> wrote:
> On Saturday 06 December 2003 02:44, Karam Chand
> wrote:
> 
> > The output is
> >
> > StartEnd
> 
> Good, that shows your PHP program is being executed.
> 
> > I am sure that the linux binary is ok. coz if in
> the
> > sheel you just do
> >
> > ./myapp
> >
> > it outputs
> >
> > error
> >
> > seems that the binary is not getting executred. I
> > think there is some permission info.
> 
> Not necessarily. Now it's time to check the manual
> entry for exec() to see 
> what *exactly* that function does. You'll find that
> you're using it 
> incorrectly (or it doesn't do what *you* think it
> should do).
> 
> > if i do phpinfo() i get the following output for
> safe
> > stuff -
> >
> > safe_mode Off Off
> 
> Good, that rules out a lot of other possibilities as
> to why your program isn't 
> working.
> 
> -- 
> Jason Wong -> Gremlins Associates ->
> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet
> Applications Development *
> ------------------------------------------
> Search the list archives before you post
> http://marc.theaimsgroup.com/?l=php-general
> ------------------------------------------
> /*
> The doctrine of human equality reposes on this: that
> there is no man
> really clever who has not found that he is stupid.
>               -- Gilbert K. Chesterson
> */
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


__________________________________
Do you Yahoo!?
Free Pop-Up Blocker - Get it now
http://companion.yahoo.com/

--- End Message ---
--- Begin Message ---
Greetings-
I'm have the follwing string called $text and throughout this string I'd
like to split this into an array by calling spliti() at the tag called
PAGEBREAK.

So, I count the array elements starting at 0 and get to 9.

When I call count(), I get 11. Could somebody please explain why this is?
Thank you.
TR
.................

<?
$text="

aaa[PAGEBREAK] //this is the 0 element
bbb[PAGEBREAK] //[1]
ccc[PAGEBREAK] //[2]
ddd[PAGEBREAK] //[3]
eee[PAGEBREAK] //[4]
fff[PAGEBREAK] //[5]
ggg[PAGEBREAK] //[6]
hhh[PAGEBREAK] //[7]
iii[PAGEBREAK] //[8]
jjj[PAGEBREAK] //...and this is the 9th element

";

$regexp="\[PAGEBREAK]";
$textarray=spliti($regexp,$text);
$num_array=count($textarray);
$another_num_array=count($textarray)-1;

echo "There are ".$num_array." elements using the count() function.<br>";
echo "If I subtract 1 since elements begin at 0, there are
".$another_num_array.".";


//This is the output using count():
//...............
//There are 11 elements using the count() function.
//If I subtract 1 since elements begin at 0, there are 10

?>

--- End Message ---
--- Begin Message ---
I found one problem. I had to add "=shared" after --enable-my_ext.
So, this is what I did:

./configure --enable-my_ext=shared


Now, the makefile looks much better. (I have attached the Makefile.) However, I get errors in make. Those errors are generated when invoking the libtool command.



[EMAIL PROTECTED] tryExtendPHP4.3.3]$ make
/bin/sh /home/anas/shop/tryExtendPHP4.3.3/libtool --mode=compile gcc -I. -I/home/anas/shop/tryExtendPHP4.3.3 -DPHP_ATOM_INC -I/home/anas/shop/tryExtendPHP4.3.3/include -I/home/anas/shop/tryExtendPHP4.3.3/main -I/home/anas/shop/tryExtendPHP4.3.3 -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/Zend -I/usr/local/include/php/TSRM -DHAVE_CONFIG_H -g -O2 -prefer-pic -c /home/anas/shop/tryExtendPHP4.3.3/my_ext.c -o my_ext.lo
/home/anas/shop/tryExtendPHP4.3.3/libtool: s%^.*/%%: No such file or directory
/home/anas/shop/tryExtendPHP4.3.3/libtool: -e: command not found
/home/anas/shop/tryExtendPHP4.3.3/libtool: -e: command not found
/home/anas/shop/tryExtendPHP4.3.3/libtool: -e: command not found
/home/anas/shop/tryExtendPHP4.3.3/libtool: -e: command not found
/home/anas/shop/tryExtendPHP4.3.3/libtool: -e: command not found
/home/anas/shop/tryExtendPHP4.3.3/libtool: -e: command not found
/home/anas/shop/tryExtendPHP4.3.3/libtool: -e: command not found
/home/anas/shop/tryExtendPHP4.3.3/libtool: -e: command not found
/home/anas/shop/tryExtendPHP4.3.3/libtool: -e: command not found
/home/anas/shop/tryExtendPHP4.3.3/libtool: -e: command not found
/home/anas/shop/tryExtendPHP4.3.3/libtool: -e: command not found
/home/anas/shop/tryExtendPHP4.3.3/libtool: -e: command not found
/home/anas/shop/tryExtendPHP4.3.3/libtool: -e: command not found
/home/anas/shop/tryExtendPHP4.3.3/libtool: -e: command not found
/home/anas/shop/tryExtendPHP4.3.3/libtool: -e: command not found
/home/anas/shop/tryExtendPHP4.3.3/libtool: -e: command not found
/home/anas/shop/tryExtendPHP4.3.3/libtool: -e: command not found
: compile: cannot determine name of library object from `'
make: *** [my_ext.lo] Error 1




I don't know what is going on. Could some expert please advise.
Thank you.



Here is output of the same command with --debug option:


[EMAIL PROTECTED] tryExtendPHP4.3.3]$ make
/bin/sh /home/anas/shop/tryExtendPHP4.3.3/libtool --debug --mode=compile gcc -I. -I/home/anas/shop/tryExtendPHP4.3.3 -DPHP_ATOM_INC -I/home/anas/shop/tryExtendPHP4.3.3/include -I/home/anas/shop/tryExtendPHP4.3.3/main -I/home/anas/shop/tryExtendPHP4.3.3 -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/Zend -I/usr/local/include/php/TSRM -DHAVE_CONFIG_H -g -O2 -prefer-pic -c /home/anas/shop/tryExtendPHP4.3.3/my_ext.c -o my_ext.lo
/home/anas/shop/tryExtendPHP4.3.3/libtool: s%^.*/%%: No such file or directory
: enabling shell trace mode
+ test 20 -gt 0
+ arg=--mode=compile
+ shift
++ echo X--mode=compile
++ -e '1s/^X//' -e 's/[-_a-zA-Z0-9]*=//'
/home/anas/shop/tryExtendPHP4.3.3/libtool: -e: command not found
+ optarg=
+ test -n ''
+ mode=
+ test 19 -gt 0
+ arg=gcc
+ shift
+ optarg=
+ test -n ''
+ nonopt=gcc
+ break
+ test -n ''
+ exec_cmd=
+ test -z ''
+ test -z ''
+ mode=link
+ mode=compile
+ break
+ test -n ''
+ generic_help=Try ` --help' for more information.
+ help=Try ` --help --mode=compile' for more information.
+ modename=: compile
+ base_compile=
+ prev=
+ lastarg=
+ srcfile=gcc
+ suppress_output=
+ user_target=no
+ lastarg=gcc
+ srcfile=-I.
++ echo Xgcc
++ -e '1s/^X//' -e 's/\([\\`\\"$\\\\]\)/\\\1/g'
/home/anas/shop/tryExtendPHP4.3.3/libtool: -e: command not found
+ lastarg=
+ lastarg=""
+ test -z ''
+ base_compile=""
+ lastarg=-I.
+ srcfile=-I/home/anas/shop/tryExtendPHP4.3.3
++ echo X-I.
++ -e '1s/^X//' -e 's/\([\\`\\"$\\\\]\)/\\\1/g'
/home/anas/shop/tryExtendPHP4.3.3/libtool: -e: command not found
+ lastarg=
+ lastarg=""
+ test -z '""'
+ base_compile="" ""
+ lastarg=-I/home/anas/shop/tryExtendPHP4.3.3
+ srcfile=-DPHP_ATOM_INC
++ echo X-I/home/anas/shop/tryExtendPHP4.3.3
++ -e '1s/^X//' -e 's/\([\\`\\"$\\\\]\)/\\\1/g'
/home/anas/shop/tryExtendPHP4.3.3/libtool: -e: command not found
+ lastarg=
+ lastarg=""
+ test -z '"" ""'
+ base_compile="" "" ""
+ lastarg=-DPHP_ATOM_INC
+ srcfile=-I/home/anas/shop/tryExtendPHP4.3.3/include
++ echo X-DPHP_ATOM_INC
++ -e '1s/^X//' -e 's/\([\\`\\"$\\\\]\)/\\\1/g'
/home/anas/shop/tryExtendPHP4.3.3/libtool: -e: command not found
+ lastarg=
+ lastarg=""
+ test -z '"" "" ""'
+ base_compile="" "" "" ""
+ lastarg=-I/home/anas/shop/tryExtendPHP4.3.3/include
+ srcfile=-I/home/anas/shop/tryExtendPHP4.3.3/main
++ echo X-I/home/anas/shop/tryExtendPHP4.3.3/include
++ -e '1s/^X//' -e 's/\([\\`\\"$\\\\]\)/\\\1/g'
/home/anas/shop/tryExtendPHP4.3.3/libtool: -e: command not found
+ lastarg=
+ lastarg=""
+ test -z '"" "" "" ""'
+ base_compile="" "" "" "" ""
+ lastarg=-I/home/anas/shop/tryExtendPHP4.3.3/main
+ srcfile=-I/home/anas/shop/tryExtendPHP4.3.3
++ echo X-I/home/anas/shop/tryExtendPHP4.3.3/main
++ -e '1s/^X//' -e 's/\([\\`\\"$\\\\]\)/\\\1/g'
/home/anas/shop/tryExtendPHP4.3.3/libtool: -e: command not found
+ lastarg=
+ lastarg=""
+ test -z '"" "" "" "" ""'
+ base_compile="" "" "" "" "" ""
+ lastarg=-I/home/anas/shop/tryExtendPHP4.3.3
+ srcfile=-I/usr/local/include/php
++ echo X-I/home/anas/shop/tryExtendPHP4.3.3
++ -e '1s/^X//' -e 's/\([\\`\\"$\\\\]\)/\\\1/g'
/home/anas/shop/tryExtendPHP4.3.3/libtool: -e: command not found
+ lastarg=
+ lastarg=""
+ test -z '"" "" "" "" "" ""'
+ base_compile="" "" "" "" "" "" ""
+ lastarg=-I/usr/local/include/php
+ srcfile=-I/usr/local/include/php/main
++ echo X-I/usr/local/include/php
++ -e '1s/^X//' -e 's/\([\\`\\"$\\\\]\)/\\\1/g'
/home/anas/shop/tryExtendPHP4.3.3/libtool: -e: command not found
+ lastarg=
+ lastarg=""
+ test -z '"" "" "" "" "" "" ""'
+ base_compile="" "" "" "" "" "" "" ""
+ lastarg=-I/usr/local/include/php/main
+ srcfile=-I/usr/local/include/php/Zend
++ echo X-I/usr/local/include/php/main
++ -e '1s/^X//' -e 's/\([\\`\\"$\\\\]\)/\\\1/g'
/home/anas/shop/tryExtendPHP4.3.3/libtool: -e: command not found
+ lastarg=
+ lastarg=""
+ test -z '"" "" "" "" "" "" "" ""'
+ base_compile="" "" "" "" "" "" "" "" ""
+ lastarg=-I/usr/local/include/php/Zend
+ srcfile=-I/usr/local/include/php/TSRM
++ echo X-I/usr/local/include/php/Zend
++ -e '1s/^X//' -e 's/\([\\`\\"$\\\\]\)/\\\1/g'
/home/anas/shop/tryExtendPHP4.3.3/libtool: -e: command not found
+ lastarg=
+ lastarg=""
+ test -z '"" "" "" "" "" "" "" "" ""'
+ base_compile="" "" "" "" "" "" "" "" "" ""
+ lastarg=-I/usr/local/include/php/TSRM
+ srcfile=-DHAVE_CONFIG_H
++ echo X-I/usr/local/include/php/TSRM
++ -e '1s/^X//' -e 's/\([\\`\\"$\\\\]\)/\\\1/g'
/home/anas/shop/tryExtendPHP4.3.3/libtool: -e: command not found
+ lastarg=
+ lastarg=""
+ test -z '"" "" "" "" "" "" "" "" "" ""'
+ base_compile="" "" "" "" "" "" "" "" "" "" ""
+ lastarg=-DHAVE_CONFIG_H
+ srcfile=-g
++ echo X-DHAVE_CONFIG_H
++ -e '1s/^X//' -e 's/\([\\`\\"$\\\\]\)/\\\1/g'
/home/anas/shop/tryExtendPHP4.3.3/libtool: -e: command not found
+ lastarg=
+ lastarg=""
+ test -z '"" "" "" "" "" "" "" "" "" "" ""'
+ base_compile="" "" "" "" "" "" "" "" "" "" "" ""
+ lastarg=-g
+ srcfile=-O2
++ echo X-g
++ -e '1s/^X//' -e 's/\([\\`\\"$\\\\]\)/\\\1/g'
/home/anas/shop/tryExtendPHP4.3.3/libtool: -e: command not found
+ lastarg=
+ lastarg=""
+ test -z '"" "" "" "" "" "" "" "" "" "" "" ""'
+ base_compile="" "" "" "" "" "" "" "" "" "" "" "" ""
+ pic_mode=yes
+ continue
+ lastarg=-O2
+ srcfile=-c
++ echo X-O2
++ -e '1s/^X//' -e 's/\([\\`\\"$\\\\]\)/\\\1/g'
/home/anas/shop/tryExtendPHP4.3.3/libtool: -e: command not found
+ lastarg=
+ lastarg=""
+ test -z '"" "" "" "" "" "" "" "" "" "" "" "" ""'
+ base_compile="" "" "" "" "" "" "" "" "" "" "" "" "" ""
+ lastarg=-c
+ srcfile=/home/anas/shop/tryExtendPHP4.3.3/my_ext.c
++ echo X-c
++ -e '1s/^X//' -e 's/\([\\`\\"$\\\\]\)/\\\1/g'
/home/anas/shop/tryExtendPHP4.3.3/libtool: -e: command not found
+ lastarg=
+ lastarg=""
+ test -z '"" "" "" "" "" "" "" "" "" "" "" "" "" ""'
+ base_compile="" "" "" "" "" "" "" "" "" "" "" "" "" "" ""
+ test no '!=' no
+ user_target=next
+ user_target=yes
+ continue
+ user_target=set
+ libobj=my_ext.lo
+ continue
+ xform=[cCFSfmso]
++ echo Xmy_ext.lo
++ -e '1s/^X//' -e 's/\.[cCFSfmso]$/.lo/'
/home/anas/shop/tryExtendPHP4.3.3/libtool: -e: command not found
+ libobj=
+ echo ': compile: cannot determine name of library object from `'\'''
: compile: cannot determine name of library object from `'
+ exit 1
make: *** [my_ext.lo] Error 1






Curt Zirzow wrote:

* Thus wrote Anas Mughal ([EMAIL PROTECTED]):

I have followed the instructions in the PHP documentation on how to build a custom dynamic extension. After running ext_skel, I did NOT add any custom methods. I built the extension using the followind commands:

Compiling cc -fpic -DCOMPILE_DL=1 -I/usr/local/include -I. -I.. -I../Zend -c -o <your_object_file> <your_c_file>

Linking cc -shared -L/usr/local/lib -rdynamic -o <your_module_file> <your_object_file(s)>


1. edit the config.m4 and remove the dnl's on the lines that look somethign like: dnl PHP_ARG_ENABLE(baz, whether to enable baz support, dnl Make sure that the comment is aligned: dnl [ --enable-baz Enable baz support])

2. ./phpize

Creates the configure environment

3. ./configure --enable-baz
4. make
5. make install

the make install just copies the file in the modules/ dir to your
php module directory.

HTH,

Curt


srcdir = /home/anas/shop/tryExtendPHP4.3.3
builddir = /home/anas/shop/tryExtendPHP4.3.3
top_srcdir = /home/anas/shop/tryExtendPHP4.3.3
top_builddir = /home/anas/shop/tryExtendPHP4.3.3
SHLIB_SUFFIX_NAME = so
shared_objects_my_ext = my_ext.lo
PHP_MODULES = $(phplibdir)/my_ext.la
all_targets = $(PHP_MODULES)
install_targets = install-modules
prefix = /usr/local
exec_prefix = $(prefix)
libdir = ${exec_prefix}/lib
prefix = /usr/local
phplibdir = /home/anas/shop/tryExtendPHP4.3.3/modules
PHP_COMPILE =
CC = gcc
CFLAGS = -g -O2
CFLAGS_CLEAN = -g -O2
CPP = gcc -E
CPPFLAGS = -DHAVE_CONFIG_H
CXX =
DEFS =
EXTENSION_DIR = /usr/local/lib/php/extensions/no-debug-non-zts-20020429
EXTRA_LDFLAGS =
EXTRA_LIBS =
INCLUDES = -I/usr/local/include/php -I/usr/local/include/php/main 
-I/usr/local/include/php/Zend -I/usr/local/include/php/TSRM
LEX =
LEX_OUTPUT_ROOT =
LFLAGS =
LDFLAGS =
SHARED_LIBTOOL =
LIBTOOL = $(SHELL) $(top_builddir)/libtool
SHELL = /bin/sh
AWK = gawk
mkinstalldirs = $(top_srcdir)/build/shtool mkdir -p
INSTALL = $(top_srcdir)/build/shtool install -c
INSTALL_DATA = $(INSTALL) -m 644

DEFS = -DPHP_ATOM_INC -I$(top_builddir)/include -I$(top_builddir)/main -I$(top_srcdir)
COMMON_FLAGS = $(DEFS) $(INCLUDES) $(EXTRA_INCLUDES) $(CPPFLAGS) $(PHP_FRAMEWORKPATH)


all: $(all_targets) 
        @echo
        @echo "Build complete."
        @echo "(It is safe to ignore warnings about tempnam and tmpnam)."
        @echo
        
build-modules: $(PHP_MODULES)

libphp4.la: $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS)
        $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -rpath $(phptempdir) 
$(EXTRA_LDFLAGS) $(LDFLAGS) $(PHP_RPATHS) $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS) 
$(EXTRA_LIBS) $(ZEND_EXTRA_LIBS) -o $@
        [EMAIL PROTECTED](LIBTOOL) --silent --mode=install cp libphp4.la 
$(phptempdir)/libphp4.la >/dev/null 2>&1

libs/libphp4.bundle: $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS)
        $(CC) $(MH_BUNDLE_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) 
$(EXTRA_LDFLAGS) $(PHP_GLOBAL_OBJS:.lo=.o) $(PHP_SAPI_OBJS:.lo=.o) $(PHP_FRAMEWORKS) 
$(EXTRA_LIBS) $(ZEND_EXTRA_LIBS) -o $@ && cp $@ libs/libphp4.so

install: $(all_targets) $(install_targets)

install-sapi: $(OVERALL_TARGET)
        @echo "Installing PHP SAPI module:       $(PHP_SAPI)"
        [EMAIL PROTECTED](mkinstalldirs) $(INSTALL_ROOT)$(bindir)
        [EMAIL PROTECTED] test ! -r $(phptempdir)/libphp4.$(SHLIB_SUFFIX_NAME); then \
                for i in 0.0.0 0.0 0; do \
                        if test -r $(phptempdir)/libphp4.$(SHLIB_SUFFIX_NAME).$$i; 
then \
                                $(LN_S) $(phptempdir)/libphp4.$(SHLIB_SUFFIX_NAME).$$i 
$(phptempdir)/libphp4.$(SHLIB_SUFFIX_NAME); \
                                break; \
                        fi; \
                done; \
        fi
        @$(INSTALL_IT)

install-modules: build-modules
        @test -d modules && \
        $(mkinstalldirs) $(INSTALL_ROOT)$(EXTENSION_DIR) && \
        echo "Installing shared extensions:     $(INSTALL_ROOT)$(EXTENSION_DIR)/" && \
        rm -f modules/*.la && \
        $(INSTALL) modules/* $(INSTALL_ROOT)$(EXTENSION_DIR) >/dev/null 2>&1 || true

install-tester:
        @echo "Installing regression tester:     $(INSTALL_ROOT)$(PEAR_INSTALLDIR)/"
        @$(mkinstalldirs) $(INSTALL_ROOT)$(PEAR_INSTALLDIR)
        @$(INSTALL) -m 755 $(top_srcdir)/run-tests.php 
$(INSTALL_ROOT)$(PEAR_INSTALLDIR)

install-su: install-pear install-tester

test: 
        [EMAIL PROTECTED] test -x $(SAPI_CLI_PATH) && test ! -z $(SAPI_CLI_PATH); then 
\
                TEST_PHP_EXECUTABLE=$(top_builddir)/$(SAPI_CLI_PATH) \
                TEST_PHP_SRCDIR=$(top_srcdir) \
                CC="$(CC)" \
                        $(top_builddir)/$(SAPI_CLI_PATH) -d 'open_basedir=' -d 
'safe_mode=0' -d 'output_buffering=0' $(top_srcdir)/run-tests.php $(TESTS); \
        else \
                echo "ERROR: Cannot run tests without CLI sapi."; \
        fi

clean:
        find . -name \*.lo | xargs rm -f
        find . -name \*.o | xargs rm -f
        find . -name \*.la | xargs rm -f
        find . -name \*.a | xargs rm -f
        find . -name \*.so | xargs rm -f
        find . -name .libs -a -type d|xargs rm -rf
        rm -f libphp4.la $(SAPI_CLI_PATH) $(OVERALL_TARGET) modules/* libs/*

distclean: clean
        rm -f config.cache config.log config.status Makefile.objects 
Makefile.fragments libtool main/php_config.h stamp-h php4.spec 
sapi/apache/libphp4.module buildmk.stamp
        egrep define'.*include/php' configure|sed 's/.*>//'|xargs rm -f
        find . -name Makefile | xargs rm -f

.PHONY: all clean install distclean test
.NOEXPORT:
my_ext.lo: /home/anas/shop/tryExtendPHP4.3.3/my_ext.c
        $(LIBTOOL) --debug --mode=compile $(CC)  -I. 
-I/home/anas/shop/tryExtendPHP4.3.3 $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) 
-prefer-pic -c /home/anas/shop/tryExtendPHP4.3.3/my_ext.c -o my_ext.lo 
$(phplibdir)/my_ext.la: ./my_ext.la
        $(LIBTOOL) --mode=install cp ./my_ext.la $(phplibdir)

./my_ext.la: $(shared_objects_my_ext) $(MY_EXT_SHARED_DEPENDENCIES)
        $(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) 
$(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath 
$(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_my_ext) $(MY_EXT_SHARED_LIBADD)


--- End Message ---
--- Begin Message --- Okay, solved that as well.
SED environment variable was not defined!
How come I had to define it myself?! Shouldn't the build process take care of that?


Anyway, now when I try to load the extension my_ext.la in my PHP as follows:

if(!extension_loaded('my_ext')) {
        dl('my_ext.la');
}


I get the following error:


Warning: dl(): Unable to load dynamic library '/usr/local/apache/htdocs/my_ext.la' - /usr/local/apache/htdocs/my_ext.la: invalid ELF header in /usr/local/apache/htdocs/my_ext.php on line 4


It is very strange to see this error. I have done all my development on one Redhat Linux box. I didn't switch OS platforms.


Please advise. Thanks.




Anas Mughal wrote:


I found one problem. I had to add "=shared" after --enable-my_ext.
So, this is what I did:

./configure --enable-my_ext=shared


Now, the makefile looks much better. (I have attached the Makefile.) However, I get errors in make. Those errors are generated when invoking the libtool command.


.......

--- End Message ---
--- Begin Message ---
I figured it out!
I was loading the wrong file (slap-on-the-forehead).
Sorry about my last email.

Curt, thank you for helping me out.
Now, my first dummy extension is working.... :))




Anas Mughal wrote:


Okay, solved that as well.
SED environment variable was not defined!
How come I had to define it myself?! Shouldn't the build process take care of that?


Anyway, now when I try to load the extension my_ext.la in my PHP as follows:

if(!extension_loaded('my_ext')) {
        dl('my_ext.la');
}


I get the following error:


Warning: dl(): Unable to load dynamic library '/usr/local/apache/htdocs/my_ext.la' - /usr/local/apache/htdocs/my_ext.la: invalid ELF header in /usr/local/apache/htdocs/my_ext.php on line 4


It is very strange to see this error. I have done all my development on one Redhat Linux box. I didn't switch OS platforms.


Please advise. Thanks.




Anas Mughal wrote:


I found one problem. I had to add "=shared" after --enable-my_ext.
So, this is what I did:

./configure --enable-my_ext=shared


Now, the makefile looks much better. (I have attached the Makefile.) However, I get errors in make. Those errors are generated when invoking the libtool command.


.......



--- End Message ---
--- Begin Message --- I need to parse UIEE files for a project. Has anyone done that before? Any pointers?
--- End Message ---
--- Begin Message ---
"CPT John W. Holmes" wrote:
 
> From: "Adam i Agnieszka Gasiorowski FNORD" <[EMAIL PROTECTED]>
> 
> >  No, no spaces between letters (otherways
> >  it would be very easy, indeed). So there is
> >  no way to match the "space between alphanumeric
> >  chars" and split on it? I was trying to avoid
> >  the loop solution.
> 
> Of course there is. In fact, this example, direct from the manual, does
> exactly what you want...
> 
> <?php
> $str = 'string';
> $chars = preg_split('//', $str, -1, PREG_SPLIT_NO_EMPTY);
> print_r($chars);
> ?>
> Imagine that!---John Holmes...

        LOL! :8]]
        
        You are SO right. I just KNEW the
 solution existed, I must have even read
 it a long time ago in the very manual...
 Sorry for wasting your precious time :8].
 Thank you and all the others that tried
 to help!

-- 
Seks, seksić, seksolatki... news:pl.soc.seks.moderowana
http://hyperreal.info  { iWanToDie }   WiNoNa    )   (
http://szatanowskie-ladacznice.0-700.pl  foReVeR(  *  )
Poznaj jej zwiewne kształty... http://www.opera.com 007

--- End Message ---
--- Begin Message ---
it doesn't matter! whatever u think, and what your job is.
it's all up to IT manager(?) are they listen to us or
do they know what's the newest verion in php or mysql.
i wouldn't think so (it got to kidding!)

as we are professional... we got to act like a real prof. but.. ?

here u go!

my dev. env. is on win2k pro + sp4, php 5.00b2, apache 2.0.48, mysql 4.0.16, MS Access(?), XML, XSLT and without worries.

production env. - i do not care (actually i can't do anything about it.) but recommend whatever linux (free), and php 4.3.4, apache 2.0.48, and mysql 4.0.16.

in real life, our server runs php 4.1x, mysql 3.0x, apache 1.3.x.
(register_globals = on, what a life, but i codes it eveything for OFF
so that it should work later on if they upgraded it php 5.0x, r they?).

is there anyone check updates except us.

that's my story.

Yves Arsenault wrote:

Would anyone know of the issues that might affect PHP 4.3.4 and Apache
2.0.48 ?

Thanks,

Yves

-----Original Message-----
From: Martin Hudec [mailto:[EMAIL PROTECTED]
Sent: 5 décembre 2003 10:52
To: PHP-General
Subject: Re: [PHP] Apache 2 + PHP


Hi there,


when I had Gentoo Linux, I was using Apache 2.0.48 with PHP 4.3.4 installed
from Gentoo portage. It was running <10 smallscale php/mysql based
virtualhosts without any difficulties.

On Friday 05 December 2003 15:24, Yves Arsenault wrote:

Is this warning outdated?
http://www.php.net/manual/en/install.apache2.php
"Do not use Apache 2.0 and PHP in a production environment neither on Unix
nor on Windows."
I'm running RedHat 9.

I've got Apache 2.0.48 running and was ready to install the latest php
4.3.x..
Just thought I would check.

-- : :. kind regards :.. Martin Hudec :.: :.: =w= http://www.aeternal.net :.: =m= +421.907.303393 :.: [EMAIL PROTECTED] [EMAIL PROTECTED] :.: :.: "When you want something, all the universe :.: conspires in helping you to achieve it." :.: - The Alchemist (Paulo Coelho)

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

--- End Message ---
--- Begin Message --- Ryan A wrote:
Hi,
I am totally new to using RSS feeds and need a little help.

I downloaded a few good classes to use RSS but dont know where to get the
feeds from...

Say hello to www.syndic8.com :D
(had the same problem trying to get a list of feeds for my own non-commercial site)


our site is going to be totally PHP geared:
eg:
PHP Articles
Program snippets
(forum (maybe))
etc

Any idea how I can get a feed from Slashdot? or any other good
programming\tech sites

Some sites that provide RSS feeds also include this tag in their HTML :
<link rel="alternate" type="application/rss+xml" title="RSS" href="http://www.domain.com/path/to/feed.xml"; />


You could search for that. If you have a windows computer around, I would recommend downloading a copy of FeedDemon [ http://www.bradsoft.com/feeddemon/index.asp ] (yes, that's the same guy that created TopStyle) -- it comes with a lot of Web Development related feeds (you can then use the URLs in your own reader).

am basically trying to get a feed from around 4 sites for around 5 links
each...

http://www.zend.com/zend_rss.php is a good one to have



-- Burhan Khalid phplist[at]meidomus[dot]com http://www.meidomus.com ----------------------- "Documentation is like sex: when it is good, it is very, very good; and when it is bad, it is better than nothing."

--- End Message ---
--- Begin Message ---
I am trying tooth and nail to create a method of copying a string of text to
the server's clipboard via php.

I have found a couple of short pieces of code to do exactly that in C, so
compiled the program and in a command prompt it works like a charm - in my
case it reads the contents of a text file and copies that to the clipboard.

I then try using a php script to execute that file using shell_exec(),
exec() and system() to no luck, every time the command:

$outpt = shell_exec("clipboard.exe") or die ("failed to execute");Would just
print out the die message.

I set about writing my own C program to copy the contents of the text file
first to the screen, and then to a char array which could then be passed to
the clipboard.

All of these self made programs could be executed by shell_exec() - so I
thought I was finally onto a winner. However it seems that I can't just pass
a char array to SetClipboardData - it has to be a block of Globally Movable
memory, which sadly I don't understand.


Is there any reason why PHP shell_exec() or other execution commands are
unable to run a program that tampers with memory? I can't say I understand..
The other question would be - how could I modify either of the exe files to
work with PHP?

Thankyou for your time and knowledge :)

clipper.php <-- php code for shell_exec commands. change which line is
commented to test the second method
clipboard.cpp <-- clipboard executable found from google, works in command
prompt but 'fails to execute' with PHP
clipper.cpp <-- clipboard executable I wrote, which doesn't actually work,
but can be executed with PHP

--- End Message ---

Reply via email to