[PHP] cURL on freebsd

2010-03-30 Thread Shane Hill
can anyone tell me why the cURL code below produces a POST request as
expected on linux, but the same code on freebsd is forced to be a GET
request?

the linux box is running php 5.2.11
the freebsd box is running 5.3.2

is there a bug in 5.3.2?  a search does not turn anything up.

=

   function makePostRequest( $url , $params ) {
$ch = curl_init();

curl_setopt($ch, CURLOPT_POST, 1);

curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
$headers = array(
'Content-type: application/json',
'Expect:'
);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_UPLOAD, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
$content = curl_exec($ch);

$errorCode = (int)curl_getinfo($ch,
CURLINFO_HTTP_CODE);
return array(content = $content, errorCode =
$errorCode);
}


Re: [PHP] cURL on freebsd

2010-03-30 Thread Shane Hill

On Mar 30, 2010, at 19:50, Tommy Pham tommy...@gmail.com wrote:

On Tue, Mar 30, 2010 at 7:36 PM, Shane Hill shanehil...@gmail.com  
wrote:

can anyone tell me why the cURL code below produces a POST request as
expected on linux, but the same code on freebsd is forced to be a GET
request?

the linux box is running php 5.2.11
the freebsd box is running 5.3.2

is there a bug in 5.3.2?  a search does not turn anything up.



Just curious, what version of FreeBSD?  Did you compile PHP 
extensions or used the packages?


Freebsd 7.2 stable

I compiled everything

enohPi ym morf tnes

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



[PHP] PHPDFS on 20 amazon instances

2009-08-28 Thread Shane Hill
Hi folks,

A few weeks ago I started a php project for building a highly scalable
distributed file system similar to mogileFS. Well, I did just that and
called it PHPDFS and I just completed a test of PHPDFS using 20 ec2
instances and PHPDFS performed quite well.

I setup 20 (5 clients, 15 servers)  m1.large amazon instances and uploaded
250GB of data and downloaded 1.5 terabytes of data.  Total overall transfer
was 1.8 TB

The blog has more info and links to 870 graphs and the 300mb of data that
was collected and analyzed.:

http://phpdfs.blogspot.com

Here are some highlights:

   - 500 threads (5 java clients, 100 threads each)
   - 15 servers
   - ~250 GB uploaded (PUT requests) (individual files between 50k and 10mb)
   - ~1.5 Tb downloaded (GET requests)
   - ~1.8 TB transfer total
   - ~47mb / sec upload rate
   - ~201 requests / sec overall
   - The data was very evenly distributed across all nodes
   - 40 replicas were lost and totally unrecoverable amounting to .030% data
   loss

Basically,  PHPDFS performed quite well,  There was a small amount of data
loss due to one of the servers getting really hot.  What happened was a few
uploads to the hot server were corrupted and the corrupted objects were
replicated.  Better error handling and a checksum mechanism will eliminate
something like that from happening.  So that is next on the development
list.

Anyway, I just wanted to let the list know that this is coming along quite
nicely and actually has gotten some attention from the folks at the Storage
Systems Research Center at UC Santa Cruz.  http://www.ssrc.ucsc.edu/

if anyone has questions or wants to get involved please let me know.

you can download phpdfs here:

http://code.google.com/p/phpdfs/downloads/list

peace,

-Shane


Re: [PHP] Re: newbie question - php parsing

2009-07-22 Thread Shane Hill
2009/7/22 João Cândido de Souza Neto j...@consultorweb.cnt.br

 You made a mistake in your code:

 ?php the_title(); ?

 must be:

 ?php echo the_title(); ?


?= the_title(); ?

also works.

-Shane





 --
 João Cândido de Souza Neto
 SIENS SOLUÇÕES EM GESTÃO DE NEGÓCIOS
 Fone: (0XX41) 3033-3636 - JS
 www.siens.com.br

 Sebastiano Pomata lafayett...@gmail.com escreveu na mensagem
 news:70fe20d60907221355m3fa49a75ua053d2f1b9aca...@mail.gmail.com...
  Hi all,
 
  A little doubt caught me while I was writing this snippet of code for
  a wordpress template:
 
  ?php if (the_title('','',FALSE) != 'Home') { ?
  h2 class=entry-header?php the_title(); ?/h2
  ?php } ?
 
  I always thought that php was called only between the ?php ? tags,
  and I'm pretty sure that's right, while HTML code was simply wrote in
  document as is, without further logic.
  Now, I can't figure out how this snippet works: I mean, shouldn't HTML
  code be simply put on document, as it is outside php invoke?
  Effectively if the title of page is 'Home', the HTML part is totally
  skipped.
 
  Is the if construct that does all the magic inside?



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




Re: [PHP] php distributed file system

2009-07-09 Thread Shane Hill
On Thu, Jul 9, 2009 at 1:10 AM, Per Jessen p...@computer.org wrote:


 Sounds a lot like glusterfs.  http://www.gluster.org/


yep,  it is similar, except I am not aiming to be all that comprehensive of
a file system.  I really want to create something extremely robust, that can
be used in web apps and that will take just a few minutes for even a php
novice to get going. I know this is possible to achieve.

phpdfs is really no different than a standard php web app, probably easier
than most.  there are only a couple little classes and the configuration is
simple.  another thing is all of the code and technologies that phpdfs is
built upon are very very familiar to the php community already.  just php
and your favorite flavor of web server and away you go.

thanks for the note,

-Shane







 /Per

 --
 Per Jessen, Zürich (16.1°C)


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




Re: [PHP] Simple login form with cookies

2009-07-08 Thread Shane Hill
just an observation here, but are we not getting close to breaking another
rule?

Do not high-jack threads, by bringing up entirely new topics. Please create
an entirely new thread copying anything you wish to quote into the new
thread.

I know some feel this is important but if i was searching for some help with
a simple login form and cookies,  this thread would be useless.

peace,

-Shane

On Wed, Jul 8, 2009 at 12:23 PM, Bob McConnell r...@cbord.com wrote:

 From: Tony Marston

  I do not follows rules which cannot be justified beyond the expression
 It
  is there, so obey it! Why is it there? What are the alternatives?
 What harm
  does it do? What happens if the rule is disobeyed? Top posting existed
 in
  the early days of the internet, and for a logical reason. Then some
 arrogant
  prat came along and said I don't like this, so I am going to make a
 rule
  which forbids it!. I don't like this rule, so I choose to disobey it.

 Daniel already explained to you why it is there. Long threads get too
 confusing with top posting. When posted correctly they read
 chronologically from top to bottom so they can be followed and
 understood when referenced a year or two later.

 Top posting did not exist in the early days of the Internet. I was
 active on email listserves and Usenet newsgroups 18 years ago, long
 before Microsoft discovered them and decided that top posting should be
 the norm. All of the other news and email clients I have ever used
 defaulted to bottom posting. It was only in Outlook 2003 that Microsoft
 finally removed that option completely. Previous versions allowed bottom
 posting and even handled the attribution markup correctly.

 Bob McConnell

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




[PHP] php distributed file system

2009-07-08 Thread Shane Hill
hi folks,

I am on a couple of php lists and on one of them we were having a discussion
about scalable enterprise class systems to store images for things like user
photo and file uploads, etc. and whether or not something existed in php to
facilitate this.  well the discussion inspired me and I created a scalable,
cloud-like app written in php called phpdfs.  first pre-alpha release went
up monday:

http://code.google.com/p/phpdfs/

a blog is here:

http://phpdfs.blogspot.com/

if anyone is familiar with mogileFS,  phpdfs does basically the same thing
without the need of a central index to locate files across mutliple boxes.
so bye bye mysql and associated problems and hello parallelism.  phpdfs is
pure php and is really quite easy to get going.   phpdfs will replicate your
data and will automatically and optimally move data when new resources are
added (scaling out)  and old resources are removed (scaling in).

according to the authors of the algorithms upon which phpdfs is based,
Yahoo, Symantec and LSI use the algorithms in some of their products and
services.  this is for real.

currently I am testing the codebase as it is and doing a lot of empirical
data collection to show correct object distribution and that minimal data is
moved when the system is scaled out or in and that all data in the system is
highly available. The formal proofs for the algorithms can be found in the
white papers linked from the blog and the project home page. things are
still very pre-alpha but usable and will get better and better  :)

if anyone wants to help out let me know.  I hope the community finds this
useful.

peace,

-Shane