php-general Digest 20 Dec 2005 04:32:57 -0000 Issue 3860

Topics (messages 227654 through 227694):

Re: accessing RAW response
        227654 by: tg-php.gryffyndevelopment.com

Re: Write a FIFO file
        227655 by: Jay Blanchard

? Split string into smaller chunks
        227656 by: Labunski
        227658 by: Jay Blanchard
        227659 by: Anas Mughal
        227660 by: David Grant

Re: PHP/MySQL noob rides again.. into trouble
        227657 by: Eric Butera

nexcess.net
        227661 by: Miles Thompson
        227662 by: Jay Blanchard
        227663 by: Erin Fortenberry
        227664 by: John Nichel

Re: nexcess.net - Spelling!!
        227665 by: Miles Thompson

Storing encrypted data into mysql: blob vs bin2hex
        227666 by: Mark Steudel

Connecting to PHP
        227667 by: will.25sucks.com
        227668 by: Jay Blanchard
        227672 by: tg-php.gryffyndevelopment.com

PHP errors in Apache error logs
        227669 by: Jose Borquez
        227670 by: John Nichel
        227671 by: Erin Fortenberry
        227673 by: Erin Fortenberry
        227677 by: John Nichel

Re: [Bulk] Re: [PHP] PHP errors in Apache error logs
        227674 by: Jose Borquez
        227675 by: Silvio Porcellana [tradeOver]
        227680 by: Jose Borquez
        227681 by: John Nichel

Re: [Bulk] Re: [PHP] Re: [Bulk] Re: [PHP] PHP errors in Apache error logs
        227676 by: Jose Borquez

Pblm with streaming ..
        227678 by: ganu
        227691 by: Michael Hulse

MySQL - PHP's configure failed with error
        227679 by: Scott Fletcher

Passing $_POST values to a php script
        227682 by: Sumit Chachra
        227683 by: Jay Blanchard
        227686 by: Silvio Porcellana [tradeOver]

Earlier versions hurt PHP 5
        227684 by: PHPDiscuss - PHP Newsgroups and mailing lists
        227685 by: Jay Blanchard
        227687 by: Warren Vail
        227688 by: Greg Donald

Invalid argument supplied for foreach()
        227689 by: Jose Borquez
        227692 by: David Robley
        227693 by: Mark Steudel

http curl to https is that a secure connection?
        227690 by: Mark Steudel

Access Headers Submitted by Browser
        227694 by: Michael B Allen

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 ---
There's probably a better way to do it, but I'd start parsing your respond and 
search for "<?xml version="1.0" encoding="iso-8859-1"?>" and start your data 
collection after you see that.

If you're using PHP's XML parser (xml_parser_create() and such), then you don't 
have to worry about the header. It'll be disregarded since it's not 'contained' 
inside any tags.

Cheap hack, but should work fine.

-TG

= = = Original message = = =

Hi,

I am posting a request to a server from a PHP and getting a result. When I
trap the response, it comes with all the contents. Is there a method to
strip off the extra information and just capture the result?
For example I get

HTTP/1.1 200 OK
Date: Mon, 19 Dec 2005 07:25:38 GMT
Server: Apache/2.0.55 (Win32) PHP/5.1.1
X-Powered-By: PHP/5.1.1
Content-Length: 190
Connection: close
Content-Type: text/xml

<?xml version="1.0" encoding="iso-8859-1"?>
<responseValue>blah blah</responseValue>


Is it possible to just grab the "<responseValue>blah blah</responseValue>"
directly or do I have to parse through this response to get it?

Thanks in advance.


___________________________________________________________
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.

--- End Message ---
--- Begin Message ---
[snip]
I have  a problem. I have created a fifo file (under linux) and I m not 
able to append some line from a php script.  There is not output error, 
php just is executing for ever ...

How can I write a fifo file?
[/snip]

Please have a look here; http://www.php.net/file as a starting point for
file operations. You can append to a file with the fopen() function...
http://www.php.net/fopen

--- End Message ---
--- Begin Message ---
I need to split a long string into smaler chunks (an array), as a separator 
using every third \n (and not just every \n).
I could use 'explode', but then it would produce too many chunks.

Thank you in advance!

--- End Message ---
--- Begin Message ---
[snip]
I need to split a long string into smaler chunks (an array), as a separator 
using every third \n (and not just every \n).
I could use 'explode', but then it would produce too many chunks.
[/snip]

http://us2.php.net/manual/en/function.chunk-split.php

--- End Message ---
--- Begin Message ---
Split them using explode and then combine the ones you need to combined.
Hope this helps.
--
Anas Mughal



On 12/19/05, Labunski <[EMAIL PROTECTED]> wrote:
>
> I need to split a long string into smaler chunks (an array), as a
> separator
> using every third \n (and not just every \n).
> I could use 'explode', but then it would produce too many chunks.
>
> Thank you in advance!
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


--
Anas Mughal

--- End Message ---
--- Begin Message ---
Labunski wrote:
> I need to split a long string into smaler chunks (an array), as a separator 
> using every third \n (and not just every \n).
> I could use 'explode', but then it would produce too many chunks.

php.net/preg_split

Cheers,

David
-- 
David Grant
http://www.grant.org.uk/

--- End Message ---
--- Begin Message ---
>
> Could you direct me towards any good resources on general security with
> php/mysql?
>



http://phpsec.org/library/

Make sure to read these:
- data filtering
- sql injection

. . .and all the others in time. =)

--- End Message ---
--- Begin Message ---
Anyone using nexecess.net, and have an opinion pro or con?

Miles

--- End Message ---
--- Begin Message ---
[snip]
Anyone using nexecess.net, and have an opinion pro or con?
[/snip]

Con -- the page cannot be displayed

--- End Message ---
--- Begin Message ---
I think this is what he means;

http://www.nexcess.net/ 


I can say, using their Interworx product, that they have GREAT support. I
have never used their hosting.


-Erin
 

> -----Original Message-----
> From: Jay Blanchard [mailto:[EMAIL PROTECTED] 
> Sent: Monday, December 19, 2005 12:52 PM
> To: 'Miles Thompson'; [email protected]
> Subject: RE: [PHP] nexcess.net
> 
> [snip]
> Anyone using nexecess.net, and have an opinion pro or con?
> [/snip]
> 
> Con -- the page cannot be displayed
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

--- End Message ---
--- Begin Message ---
Jay Blanchard wrote:
[snip]
Anyone using nexecess.net, and have an opinion pro or con?
[/snip]

Con -- the page cannot be displayed


Well, depends on the contents of the page. I've seen some sites where it would be considered a 'pro' if the page couldn't be displayed. ;)

--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]

--- End Message ---
--- Begin Message ---
Apologies, I should have written,

Is anyone using nexcess.net? Opinion, pro or con?
I'm not usually swayed by advertising, but as they're supporting PHP|architect though they deserved a look.

Miles
At 01:48 PM 12/19/2005, Miles Thompson wrote:
Anyone using nexecess.net, and have an opinion pro or con?

Miles

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


--- End Message ---
--- Begin Message ---
 
I have the following encryption function. And what I wanted to know is, Do I
need to convert this to hex before storing this in a mysql database? Or
could I store it into a blob and be fine?

// from zend code gallery
function RC4($keyfile, $data) { //ecncrypt $data with the key in $keyfile
with an rc4 algorithm 
    $pwd = implode('', file($keyfile)); 
        $pwd_length = strlen($pwd); 
    for ($i = 0; $i < 255; $i++) { 
          $key[$i] = ord(substr($pwd, ($i % $pwd_length)+1, 1)); 
            $counter[$i] = $i; 
        } 
        for ($i = 0; $i < 255; $i++) { 
            $x = ($x + $counter[$i] + $key[$i]) % 256; 
            $temp_swap = $counter[$i]; 
            $counter[$i] = $counter[$x]; 
            $counter[$x] = $temp_swap; 

        } 
        for ($i = 0; $i < strlen($data); $i++) { 
                        $a = ($a + 1) % 256; 
            $j = ($j + $counter[$a]) % 256; 
            $temp = $counter[$a]; 
            $counter[$a] = $counter[$j]; 
            $counter[$j] = $temp; 
            $k = $counter[(($counter[$a] + $counter[$j]) % 256)]; 
            $Zcipher = ord(substr($data, $i, 1)) ^ $k; 
            $Zcrypt .= chr($Zcipher); 
        } 
        return $Zcrypt; 
} 

--- End Message ---
--- Begin Message ---
I know there are lots of ways to allow php to connect to components
written in other languages.
COM, EJB JAVA, .NET Components etc.

Is there any way for another language to use PHP as a component so that
all of it's amazing
functions could be shared?  I don't suppose it exposes a COM interface
or anything of that sort?

thanks,
will

--- End Message ---
--- Begin Message ---
[snip]
I know there are lots of ways to allow php to connect to components
written in other languages.
COM, EJB JAVA, .NET Components etc.

Is there any way for another language to use PHP as a component so that
all of it's amazing
functions could be shared?  I don't suppose it exposes a COM interface
or anything of that sort?
[/snip]

PHP has COM functions http://www.php.net/com but I am unsure that this
answers your question.

--- End Message ---
--- Begin Message ---
No.. it sounds like he wants to make function calls to PHP from another app..   
kind of the reverse of using PHP's COM calls.

I'm not aware that PHP has any registration in an OS or any kind of inherent 
"listening" mechanisms like COM has (I'm phrasing that poorly but you get the 
idea).

You can call PHP via command-line and tell it to execute a script or pass it 
PHP functions to execute.

You may be able to create something that actively hooks into the Windows API 
(or whatever your native OS's event handler is) and watches for certain events 
or conditions then responds to those events.  But that would mean actively 
running a PHP script.


The idea with COM is that you can treat applications as objects.  You call the 
object, perform functions, access internal objects and properties, get it to do 
some tricks, then unload the application. Sometimes without even seeing that 
app has been called.


If that's what you want to do with PHP... then it doesn't do it natively.


Kind of an interesting thought though..  register PHP as a COM-compliant object 
in Windows. Hmm..  Would require some kind of wrapper or whatever, but it'd 
open up PHP functionality to every Microsoft product (can you imagine calling 
PHP functions from within Access or Excel or Word?).   Probably pointless 
because 99% of what you can do in PHP you can do in VBA..  not as elegantly I 
think (I've worked extensively in both) but someone may have a need.


Any thoughts?

-TG

= = = Original message = = =

[snip]
I know there are lots of ways to allow php to connect to components
written in other languages.
COM, EJB JAVA, .NET Components etc.

Is there any way for another language to use PHP as a component so that
all of it's amazing
functions could be shared?  I don't suppose it exposes a COM interface
or anything of that sort?
[/snip]

PHP has COM functions http://www.php.net/com but I am unsure that this
answers your question.


___________________________________________________________
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.

--- End Message ---
--- Begin Message --- I am attempting to configure Group Office which is a Project Management suite on FreeBSD 5.4 with apache+mod_ssl-1.3.34+2.8.25_1, MySQL 5.0.16, PHP5-MySQL 5.1.1, and PHP5.1.1 and I keep getting the following error messages in my error logs when I attempt to open a php page:

[Mon Dec 19 10:37:36 2005] [error] PHP Fatal error: Call to undefined function session_save_path() in /usr/local/www/groupoffice-com-2.14-FINAL-4/Group-Office.
php on line 792
/usr/local/www/groupoffice-com-2.14-FINAL-4/Group-Office.php(792) : Fatal error
- Call to undefined function session_save_path()

Could someone please give me any ideas as to what the problem is? Any help would be greatly appreciated.

Thanks in advance,
Jose

--- End Message ---
--- Begin Message ---
Jose Borquez wrote:
I am attempting to configure Group Office which is a Project Management suite on FreeBSD 5.4 with apache+mod_ssl-1.3.34+2.8.25_1, MySQL 5.0.16, PHP5-MySQL 5.1.1, and PHP5.1.1 and I keep getting the following error messages in my error logs when I attempt to open a php page:

[Mon Dec 19 10:37:36 2005] [error] PHP Fatal error: Call to undefined function session_save_path() in /usr/local/www/groupoffice-com-2.14-FINAL-4/Group-Office.
php on line 792
/usr/local/www/groupoffice-com-2.14-FINAL-4/Group-Office.php(792) : Fatal error
- Call to undefined function session_save_path()

Could someone please give me any ideas as to what the problem is? Any help would be greatly appreciated.

How is your version of PHP configured?  Was --disable-session set?

Setup a phpinfo page, and you'll be able to see the configuration line, and whether or not sessions are enabled.

--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]

--- End Message ---
--- Begin Message ---
It looks to me like the function session_save_path() does not exist.

You might look and see if Group Office supports PHP 5.1.x, you might have to
go back to an earlier version.


-Erin


> -----Original Message-----
> From: Jose Borquez [mailto:[EMAIL PROTECTED] 
> Sent: Monday, December 19, 2005 2:13 PM
> To: PHP Questions Lists
> Subject: [PHP] PHP errors in Apache error logs
> 
> I am attempting to configure Group Office which is a Project 
> Management 
> suite on FreeBSD 5.4 with apache+mod_ssl-1.3.34+2.8.25_1, 
> MySQL 5.0.16, 
> PHP5-MySQL 5.1.1, and PHP5.1.1 and I keep getting the following error 
> messages in my error logs when I attempt to open a php page:
> 
> [Mon Dec 19 10:37:36 2005] [error] PHP Fatal error:  Call to 
> undefined 
> function
> session_save_path() in 
> /usr/local/www/groupoffice-com-2.14-FINAL-4/Group-Office.
> php on line 792
> /usr/local/www/groupoffice-com-2.14-FINAL-4/Group-Office.php(792) : 
> Fatal error
> - Call to undefined function session_save_path()
> 
> Could someone please give me any ideas as to what the problem 
> is?  Any 
> help would be greatly appreciated.
> 
> Thanks in advance,
> Jose
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

--- End Message ---
--- Begin Message ---
You also might try;

http://www.group-office.com/forum/

They have had several people asl about the same error.


-Ein


> -----Original Message-----
> From: Erin Fortenberry 
> Sent: Monday, December 19, 2005 2:23 PM
> To: Jose Borquez; PHP Questions Lists
> Subject: RE: [PHP] PHP errors in Apache error logs
> 
> It looks to me like the function session_save_path() does not exist.
> 
> You might look and see if Group Office supports PHP 5.1.x, 
> you might have to go back to an earlier version.
> 
> 
> -Erin
> 
> 
> > -----Original Message-----
> > From: Jose Borquez [mailto:[EMAIL PROTECTED] 
> > Sent: Monday, December 19, 2005 2:13 PM
> > To: PHP Questions Lists
> > Subject: [PHP] PHP errors in Apache error logs
> > 
> > I am attempting to configure Group Office which is a Project 
> > Management 
> > suite on FreeBSD 5.4 with apache+mod_ssl-1.3.34+2.8.25_1, 
> > MySQL 5.0.16, 
> > PHP5-MySQL 5.1.1, and PHP5.1.1 and I keep getting the 
> following error 
> > messages in my error logs when I attempt to open a php page:
> > 
> > [Mon Dec 19 10:37:36 2005] [error] PHP Fatal error:  Call to 
> > undefined 
> > function
> > session_save_path() in 
> > /usr/local/www/groupoffice-com-2.14-FINAL-4/Group-Office.
> > php on line 792
> > /usr/local/www/groupoffice-com-2.14-FINAL-4/Group-Office.php(792) : 
> > Fatal error
> > - Call to undefined function session_save_path()
> > 
> > Could someone please give me any ideas as to what the problem 
> > is?  Any 
> > help would be greatly appreciated.
> > 
> > Thanks in advance,
> > Jose
> > 
> > -- 
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> > 
> > 
> 

--- End Message ---
--- Begin Message ---
Jose Borquez wrote:
<snip>
The Makefile configuration did have "--disable-all" included. Here is the link to my phpinfo page;
http://68.127.38.82/install/test.php

You have no session support.

--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]

--- End Message ---
--- Begin Message ---
John Nichel wrote:

Jose Borquez wrote:

I am attempting to configure Group Office which is a Project Management suite on FreeBSD 5.4 with apache+mod_ssl-1.3.34+2.8.25_1, MySQL 5.0.16, PHP5-MySQL 5.1.1, and PHP5.1.1 and I keep getting the following error messages in my error logs when I attempt to open a php page:

[Mon Dec 19 10:37:36 2005] [error] PHP Fatal error: Call to undefined function session_save_path() in /usr/local/www/groupoffice-com-2.14-FINAL-4/Group-Office.
php on line 792
/usr/local/www/groupoffice-com-2.14-FINAL-4/Group-Office.php(792) : Fatal error
- Call to undefined function session_save_path()

Could someone please give me any ideas as to what the problem is? Any help would be greatly appreciated.


How is your version of PHP configured?  Was --disable-session set?

Setup a phpinfo page, and you'll be able to see the configuration line, and whether or not sessions are enabled.

I installed PHP from the ports and did not do any configuration. I set up the phpinfo page and the configuration line did not set disable session.

Thanks in advance,
Jose

--- End Message ---
--- Begin Message ---
Jose Borquez wrote:
> I installed PHP from the ports and did not do any configuration.  I set
> up the phpinfo page and the configuration line did not set disable session.
> 
> Thanks in advance,
> Jose
> 

Maybe you have this:
'--disable-all'
(not sure, thou, this should enable sessions anyway, IIRC...)

Maybe you could point us to your phpinfo(), it sure would help.

Cheers
Silvio

-- 
tradeOver | http://www.tradeover.net
...ready to become the King of the World?

--- End Message ---
--- Begin Message ---
John Nichel wrote:

Jose Borquez wrote:
<snip>

The Makefile configuration did have "--disable-all" included. Here is the link to my phpinfo page;
http://68.127.38.82/install/test.php


You have no session support.

I am not sure what to do now. Do I need to uninstall and reinstall it with session support? What is the configuration I need to specify?

Thanks in advance,
Jose

--- End Message ---
--- Begin Message ---
Jose Borquez wrote:
John Nichel wrote:

Jose Borquez wrote:
<snip>

The Makefile configuration did have "--disable-all" included. Here is the link to my phpinfo page;
http://68.127.38.82/install/test.php



You have no session support.

I am not sure what to do now. Do I need to uninstall and reinstall it with session support? What is the configuration I need to specify?

Check with your OS. They _might_ have a package (port) you need to install. Probably named something like php-session

Or...

./config
make
make install ;)

--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]

--- End Message ---
--- Begin Message ---
Silvio Porcellana [tradeOver] wrote:

Jose Borquez wrote:
I installed PHP from the ports and did not do any configuration.  I set
up the phpinfo page and the configuration line did not set disable session.

Thanks in advance,
Jose


Maybe you have this:
'--disable-all'
(not sure, thou, this should enable sessions anyway, IIRC...)

Maybe you could point us to your phpinfo(), it sure would help.

Cheers
Silvio

The Makefile configuration did have "--disable-all" included. Here is the link to my phpinfo page;
http://68.127.38.82/install/test.php

Thanks in advance,
Jose

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

I hv attatched a 33 mb .mpeg file a small clip in my project, but when I click it download the whole file then open/play.

I want like, in some site I have seen the buffering/streaming, that it will show some play for 1-2 min and again buffer something and again.... so user does'nt hv to wait for the full time.

any idea how to do? I am not getting any idea/starting how to do it ...

need help..

~ 10nx...
~ ganu...

--- End Message ---
--- Begin Message ---
On Dec 19, 2005, at 12:10 PM, ganu wrote:
... any idea how to do? I am not getting any idea/starting how to do it ...

Use Flash 8.

It will convert to .FLV format. Easy as cake.

Choose to make the file external. Then you can use Progressive download/play.

With Flash 8 it is really easy to create a kick-butt vid player. Check out http://video.google.com/ for example.

You can download the Flash 8 and use the free 30 day trial.

Another option would be real player... Some would say it is best to offer many different formats for your users to choose from.

Flash is my fav though.

Hth,
Cheers,
Micky

--- End Message ---
--- Begin Message ---
I don't know what is the problem.  I'm using the GNU GCC and GNU Biutils.

--snip--
./configure --with-mysqli=../../mysql/bin/mysql_config --with-apxs2=../../ap
ache2/bin/apxs --with-unixODBC --with-openssl --with-curl --disable-libxml -
-disable-dom --enable-track-vars --enable-ftp --enable-sockets
--snip--

--snip--
checking for mcrypt support... no
checking for mhash support... no
checking whether to include mime_magic support... no
checking for MING support... no
checking for msession support... no
checking for mSQL support... no
checking for MSSQL support via FreeTDS... no
checking for MySQL support... no
checking for specified location of the MySQL UNIX socket... no
checking for MySQLi support... yes
checking whether to enable embedded MySQLi support... no
checking for mysql_set_server_option in -lmysqlclient... no
configure: error: wrong mysql library version or lib not found. Check
config.log for more information.
--snip--

config.log result...
--snip--
configure:53543: checking for mcrypt support
configure:54372: checking for mhash support
configure:54844: checking whether to include mime_magic support
configure:55199: checking for MING support
configure:56122: checking for msession support
configure:56830: checking for mSQL support
configure:57339: checking for MSSQL support via FreeTDS
configure:57987: checking for MySQL support
configure:58033: checking for specified location of the MySQL UNIX socket
configure:59186: checking for MySQLi support
configure:59232: checking whether to enable embedded MySQLi support
configure:59378: checking for mysql_set_server_option in -lmysqlclient
configure:59397: gcc -o
onftest -g -O2  -L/usr/local/src/php-5.1.1/../../mysql/lib -L/usr/local/src/
php-5.1.1/../../mysql/lib  -L/usr/local/ssl/lib -L/usr/local/ssl/lib -L/usr/
local/lib -L/usr/local/lib -lmysqlclient -lz -lcrypt -lnsl_r -lm
conftest.c -lmysqlclient  -liconv -lssl -lcrypto -lcurl -lssl -lcrypto -lm  
-lcurl -lssl -lcrypto 1>&5
ld: 0711-317 ERROR: Undefined symbol: .mysql_set_server_option
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more
information.
collect2: ld returned 8 exit status
configure: failed program was:
#line 59386 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char mysql_set_server_option();

int main() {
mysql_set_server_option()
; return 0; }
--snip--

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

I am trying to develop a testing framework for a bunch of php scripts. These files expect various kinds of data from the $_POST array. They work fine when invoked from the browser.

But I am wondering if I can programmatically pass these values so that I can stress test them in a systematic manner.

thanks!
Sumit.

--- End Message ---
--- Begin Message ---
[snip]
I am trying to develop a testing framework for a bunch of php scripts. These

files expect various kinds of data from the $_POST array. They work fine 
when invoked from the browser.

But I am wondering if I can programmatically pass these values so that I can

stress test them in a systematic manner.
[/snip]

You will probably want to use http://www.php.net/curl

--- End Message ---
--- Begin Message ---
Jay Blanchard wrote:
> [snip]
> I am trying to develop a testing framework for a bunch of php scripts. These
> 
> files expect various kinds of data from the $_POST array. They work fine 
> when invoked from the browser.
> 
> But I am wondering if I can programmatically pass these values so that I can
> 
> stress test them in a systematic manner.
> [/snip]
> 
> You will probably want to use http://www.php.net/curl
> 
You can also try the Apache benchmarking tool - ab
[http://httpd.apache.org/docs/2.0/programs/ab.html]

It can also do POST request (check the -p option)
<quote from=http://httpd.apache.org/docs/1.3/programs/ab.html>
        -p POST file
        A file containing data  that  the  program  will send  to  the
        Apache  server  in  any HTTP POST requests. The contents of the
        file  should  look like  name=value&something=other,  with
        special characters URL encoded.
</quote>

HTH, cheers

Silvio

-- 
tradeOver | http://www.tradeover.net
...ready to become the King of the World?

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

As a developer, I would love to use PHP 5+ for applications but I am
afraid to do so because 90% of web hosting companies do not offer it. The
biggest reason that that they do not offer it is because there is little
demand for it. The reason why there is little demand for it is that
developers do not use it because webhosts do not support it. A classic
catch 22 situation!

I think that continuing to offer prominent download links for PHP 4
versions on the same page as download links for php 5 on the php.net and
Zend sites is a major contributor to this problem. To get PHP 5 accepted,
links to download earlier versions should be hidden away in some obsure
area.

--- End Message ---
--- Begin Message ---
[snip]
As a developer, I would love to use PHP 5+ for applications but I am
afraid to do so because 90% of web hosting companies do not offer it. The
biggest reason that that they do not offer it is because there is little
demand for it. The reason why there is little demand for it is that
developers do not use it because webhosts do not support it. A classic
catch 22 situation!

I think that continuing to offer prominent download links for PHP 4
versions on the same page as download links for php 5 on the php.net and
Zend sites is a major contributor to this problem. To get PHP 5 accepted,
links to download earlier versions should be hidden away in some obsure
area.
[/snip]

OK.


Merry Christmas.

--- End Message ---
--- Begin Message --- Not sure where you are looking for web hosting companies, but my experience is that most hosting companies that offer Linux and Apache, love it, even back in the more stable PHP4 platform. It has a small footprint, especially when the same server hosts many domains with many web applications and when coupled with MySQL which most are, it screams speed, with a very robust collection of functions and internet connectivity capability.

I think you might want to check your figures on what "most" web hosting companies offer. I had a conversation with my host provider on this very subject and they are reporting week demand for php5, even though they expect that to change.

Warren Vail

Be careful when throwing out the bath water, there could still be a very valuable baby in it. Many PHP open source applications like PHP-Nuke and, I believe, Sugar CRM, just to name a few, are remaining on PHP4, at least for a while longer.

At 12:34 PM 12/19/2005, PHPDiscuss - PHP Newsgroups and mailing lists wrote:


As a developer, I would love to use PHP 5+ for applications but I am
afraid to do so because 90% of web hosting companies do not offer it. The
biggest reason that that they do not offer it is because there is little
demand for it. The reason why there is little demand for it is that
developers do not use it because webhosts do not support it. A classic
catch 22 situation!

I think that continuing to offer prominent download links for PHP 4
versions on the same page as download links for php 5 on the php.net and
Zend sites is a major contributor to this problem. To get PHP 5 accepted,
links to download earlier versions should be hidden away in some obsure
area.

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

--- End Message ---
--- Begin Message ---
On 12/19/05, PHPDiscuss - PHP Newsgroups and mailing lists
<[EMAIL PROTECTED]> wrote:
> As a developer, I would love to use PHP 5+ for applications but I am
> afraid to do so because 90% of web hosting companies do not offer it. The
> biggest reason that that they do not offer it is because there is little
> demand for it. The reason why there is little demand for it is that
> developers do not use it because webhosts do not support it. A classic
> catch 22 situation!

I fail to see what this has to do with a 1961 novel.  Do you mean
chicken-egg perhaps?  There's nothing keeping _you_ from using one of
those 10% who are supporting PHP5.  If you aren't part of the
solution..

> I think that continuing to offer prominent download links for PHP 4
> versions on the same page as download links for php 5 on the php.net and
> Zend sites is a major contributor to this problem.

Doubtful.  I gotta think most people who use PHP do not install it
themselves.  Those who do install it themselves are probably smart
enough to find the older versions no matter where you hide them on the
site.

> To get PHP 5 accepted,
> links to download earlier versions should be hidden away in some obsure
> area.

PHP4 does what most people need it to do.  No reason to upgrade.  You
can't really fix that since there's nothing broken.

What is in PHP5 that you _need_ exactly?  If it's OO then there are
much, much better places to get your OO fix.  Not to mention I have
never once had a client ask for PHP specifically, much less PHP5.  I
use PHP 5 because I want to stay current with my skills, not because I
need language functionality that's missing in PHP4.  Same with Apache
2, PostgreSQL 8, and MySQL 5.


--
Greg Donald
Zend Certified Engineer
MySQL Core Certification
http://destiney.com/

--- End Message ---
--- Begin Message ---
I am getting the following errors when accessing a php page:

/usr/local/www/groupoffice-com-2.14-FINAL-4/configuration/index.php(299) : Warni
ng - Invalid argument supplied for foreach()
[Mon Dec 19 15:10:52 2005] [error] PHP Warning: Invalid argument supplied for f oreach() in /usr/local/www/groupoffice-com-2.14-FINAL-4/configuration/index.php
on line 299

I solved previous php error problem by installing the php5-extensions, but now I am getting the following errors in my log files and I have no idea what it could be. Any help would be greatly appreciated.

Thanks in advance,
Jose

--- End Message ---
--- Begin Message ---
Jose Borquez wrote:

> I am getting the following errors when accessing a php page:
> 
> /usr/local/www/groupoffice-com-2.14-FINAL-4/configuration/index.php(299)
> : Warni
> ng - Invalid argument supplied for foreach()
> [Mon Dec 19 15:10:52 2005] [error] PHP Warning:  Invalid argument
> supplied for f
> oreach() in
> /usr/local/www/groupoffice-com-2.14-FINAL-4/configuration/index.php
> on line 299
> 
> I solved previous php error problem by installing the php5-extensions,
> but now I am getting the following errors in my log files and I have no
> idea what it could be.  Any help would be greatly appreciated.
> 
> Thanks in advance,
> Jose

foreach expects to have an array passed as its argument; the error message
suggests that what it is receiving is not an array. Without seeing your
code, the only suggestion we could make (well, me anyway) is to check what
is actually being passed, with print_r or var_dump.



Cheers
-- 
David Robley

Support bacteria - it's the only culture some people have!

--- End Message ---
--- Begin Message ---
Something that I use to make sure I don't give the user a nicer error

If ( is_array( $array ) )
{
        foreach ( $array as $key => $value )
        {
                echo 
        }
}
Else
{
        exit('Expecting array')
} 

-----Original Message-----
From: David Robley [mailto:[EMAIL PROTECTED] 
Sent: Monday, December 19, 2005 5:21 PM
To: [email protected]
Subject: [PHP] Re: Invalid argument supplied for foreach()

Jose Borquez wrote:

> I am getting the following errors when accessing a php page:
> 
> /usr/local/www/groupoffice-com-2.14-FINAL-4/configuration/index.php(29
> 9)
> : Warni
> ng - Invalid argument supplied for foreach() [Mon Dec 19 15:10:52 
> 2005] [error] PHP Warning:  Invalid argument supplied for f
> oreach() in
> /usr/local/www/groupoffice-com-2.14-FINAL-4/configuration/index.php
> on line 299
> 
> I solved previous php error problem by installing the php5-extensions, 
> but now I am getting the following errors in my log files and I have 
> no idea what it could be.  Any help would be greatly appreciated.
> 
> Thanks in advance,
> Jose

foreach expects to have an array passed as its argument; the error message
suggests that what it is receiving is not an array. Without seeing your
code, the only suggestion we could make (well, me anyway) is to check what
is actually being passed, with print_r or var_dump.



Cheers
--
David Robley

Support bacteria - it's the only culture some people have!

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

--- End Message ---
--- Begin Message ---
I was curious, if have a page at http and it initiates a curl session to a
https, is the information sent secure or open because the the curl session
is from a unecrypted page?
 
Mark

--- End Message ---
--- Begin Message ---
I want to read headers submitted by the client. Are these available
through some global array somewhere?

Thanks,
Mike

--- End Message ---

Reply via email to