Re: [PHP] Apache

2013-09-25 Thread Robert Stone





 De: Ashley Sheridan 
Para: m...@nikha.org; Domain nikha.org  
Cc: php-general@lists.php.net 
Enviadas: Quarta-feira, 25 de Setembro de 2013 2:22
Assunto: Re: [PHP] Apache
 



"Domain nikha.org"  wrote:
>Ashley Sheridan am Montag, 23. September 2013 - 21:35:
>
>> No, no, no! That is not a good stand-in for fundamental security
>> principles!
>> 
>> This is a better method for ensuring an image is really an image:
>> 
>> > if(isset($_FILES['file']))
>> {
>>     list($width, $height) = getimagesize($_FILES['file']['tmp_name']);
>>     if($width && $height)
>>     {
>>         $source = imagecreatefromjpeg($_FILES['file']['tmp_name']);
>>         $dest = imagecreatetruecolor($width, $height);
>>         
>>         imagecopyresampled($dest, $source,
>>         0, 0, 0, 0,
>>         $width, $height, $width, $height);
>>         imagejpeg($dest, basename($_FILES['file']['tmp_name']));
>>     }
>>     else
>>         echo "{$_FILES['file']['name']} is not a jpeg";
>> }
>> ?>
>> 
>>     
>>     
>> 
>> 
>> Obviously it's only rough, and checks only for jpeg images, but
>that's
>> easy to alter. I've just tested this with a regular jpeg, the same
>jpeg
>> with PHP code concatenated onto the end (which still appears to be a
>> valid image to viewing/editing software) and a pure PHP file with a
>.jpg
>> extension. In the case of the first 2, a new jpeg is generated with
>the
>> same image and without the code. The third example just echoes out an
>> error.
>> 
>
>Dear Ashley, nice, but useless for this problem!
>

The problem was to do with an image upload, so no, not useless. 

>First, because users may upload other things than images! PDF's, audio
>files, videos etc!

In an earlier email I detailed some methods for validating other types, such as 
DomDocument for HTML, XML, svg, etc, or fpdf for PDF. 

And on behalf images: GD you are using handles only
>jpeg, gif and png. There are about hunderd other image types on the
>way,

At the moment those are the 3 raster formats you can use on the web, so those 
are the ones that pose an issue. If you're using anything else, it's not for 
web and doesn't need to be in a publicly accessible location. 

>users can upload! How to detect them, if the extension is missleading?

The extension comes from the user. Never trust the user, ever.

>
>And even if we succeed: As your script demonstrates very well,
>malicious
>code does not affect the rendering of the image. 

My script does effectively strip out malicious code though, even if it can't 
easily be seen.

The hacker says: Hi,
>this is a nice picture, play it, and then, please do this--follows his
>code, that can be a desaster for the whole system.

Social engineering is a whole different issue.

>
>Yes, your script seems to purge the image file, simply because GD does
>not copy the malware code. But why are you sure about that? You cannot
>see that code, OK, but may be it was executed in the plain GD
>environement? 

GD isn't a PHP parser, and PHP doesn't execute the image before GD touches it. 
Infact, Apache isn't even involved between GD and the image at that point, so 
it won't suffer from this bad config.

What you are doing is dangerous, because you force the
>execution of things that should be never executed!

Erm, no, the image isn't being executed.

>
>"no no no" forget it. After all we cannot exclude that users come in
>with malware. 

If you think it's fine that a user be able to upload malware, then you're going 
to have a very bad time.

But we MUST exclude, it is executed on the web server.

This is important too, but in this profession belt and braces is best I 
believe. 

>That is the Apache chainsaw massacre as Steward whould say. And
>probably
>it can be avoided by purging the filenames (not the files!). 
>
>Nevertheless, the standard configuration of the Apache servers is
>basically unacceptable. It must execute user requests and never ever
>user files! Period.
>
>Have nice days,
>Niklaus 
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php

Thanks,
Ash

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


Sorry for this late post but I'm amazed nobody consulted the doco.

The php.net site has a whole section titled "Handling File Uploads".
Also check out finfo_open and finfo_file.
If your are a windoze user you need a dll.
If you want Apache to handle PUT requests you MUST tell it to run a script as 
it cannot write to web root.

HTH

Robert

Re: [PHP] Apache

2013-09-24 Thread Ashley Sheridan


"Domain nikha.org"  wrote:
>Ashley Sheridan am Dienstag, 24. September 2013 - 18:22:
>
>> In an earlier email I detailed some methods for validating other
>types, such
>as DomDocument for HTML, XML, svg, etc, or fpdf for PDF. 
>> 
>Fine, gratulations!
>
>> And on behalf images: GD you are using handles only
>> >jpeg, gif and png. There are about hunderd other image types on the
>> >way,
>> 
>> At the moment those are the 3 raster formats you can use on the web,
>so those
>are the ones that pose an issue. If you're using anything else, it's
>not for web
>and doesn't need to be in a publicly accessible location. 
>> 
>Why that???!!! Why should users only upload files, that are used "for
>web", and
>what does this mean, "for web"? Users may store personal files on your
>host,
>because they use your website as a "cloud", as it is said today. Not
>"for web",

Ok, imagine this scenario. A user uploads a .tif. this isn't a web format, so 
we treat it as a binary file, uploading to a non web accessible area of the 
site. Tell me again where the exploit is please.

>but for personal use on everey computer connected to the internet! That
>is
>absolutly legitime and the ONLY reason to offer file uploading I can
>imagine! I
>allow it only for authenticated, subscribed users. 
>
>Nevertheless those trusted users may upload (unintenionally!) infected
>files.
>And again: No virus was ever written "for web",

Not exactly true, but beyond the scope of this discussion I think 

 but to harm
>computersystems,
>clients and servers. They are just distributed via web.
> 
>Whould be great we could block them, and I appreciate your efforts to
>do this.
>But sorry, your script shows me, that this cannot be done this way!

Tell me how you would get a jpg past that example and I'll look into it, as I 
explained that was an example not a full solution. We don't tend to just write 
full code for people here.

>Perhaps, if
>you are right and GD processing really is harmless (I'm in doubt),

Evidence? Either give some or stop saying GD isn't secure. The PHP community 
needs less hyperbole and more facts.

 we
>have a
>clean jpeg (or gif or png). And then? What's about the rest?
>
>Keep in mind, that PHP is a scripting framework to create websites,
>certainly
>not a tool for virus detection! And we have a big problem with the
>Apache web
>server, not because Apache serves possibly infected files, but because
>all kind
>of files are NOT served, but passed to the script interpreter! 

that's a bad Apache setup, which I'm not saying isn't a problem, but your 
original "solution" doesn't even cover validation. 

That's
>awfull
>enough, and opens a new exploit!
>
>> 
>> The hacker says: Hi,
>> >this is a nice picture, play it, and then, please do this--follows
>his
>> >code, that can be a desaster for the whole system.
>> 
>> Social engineering is a whole different issue.
>> 
>yes, what I tried to describe is criminal.
>Niklaus

Thanks,
Ash

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



Re: [PHP] Apache

2013-09-24 Thread Domain nikha . org
Ashley Sheridan am Dienstag, 24. September 2013 - 18:22:

> In an earlier email I detailed some methods for validating other types, such
as DomDocument for HTML, XML, svg, etc, or fpdf for PDF. 
> 
Fine, gratulations!

> And on behalf images: GD you are using handles only
> >jpeg, gif and png. There are about hunderd other image types on the
> >way,
> 
> At the moment those are the 3 raster formats you can use on the web, so those
are the ones that pose an issue. If you're using anything else, it's not for web
and doesn't need to be in a publicly accessible location. 
> 
Why that???!!! Why should users only upload files, that are used "for web", and
what does this mean, "for web"? Users may store personal files on your host,
because they use your website as a "cloud", as it is said today. Not "for web",
but for personal use on everey computer connected to the internet! That is
absolutly legitime and the ONLY reason to offer file uploading I can imagine! I
allow it only for authenticated, subscribed users. 

Nevertheless those trusted users may upload (unintenionally!) infected files.
And again: No virus was ever written "for web", but to harm computersystems,
clients and servers. They are just distributed via web.
 
Whould be great we could block them, and I appreciate your efforts to do this.
But sorry, your script shows me, that this cannot be done this way! Perhaps, if
you are right and GD processing really is harmless (I'm in doubt), we have a
clean jpeg (or gif or png). And then? What's about the rest?

Keep in mind, that PHP is a scripting framework to create websites, certainly
not a tool for virus detection! And we have a big problem with the Apache web
server, not because Apache serves possibly infected files, but because all kind
of files are NOT served, but passed to the script interpreter! That's awfull
enough, and opens a new exploit!

> 
> The hacker says: Hi,
> >this is a nice picture, play it, and then, please do this--follows his
> >code, that can be a desaster for the whole system.
> 
> Social engineering is a whole different issue.
> 
yes, what I tried to describe is criminal.
Niklaus

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



Re: [PHP] Apache

2013-09-24 Thread Ashley Sheridan


"Domain nikha.org"  wrote:
>Ashley Sheridan am Montag, 23. September 2013 - 21:35:
>
>> No, no, no! That is not a good stand-in for fundamental security
>> principles!
>> 
>> This is a better method for ensuring an image is really an image:
>> 
>> > if(isset($_FILES['file']))
>> {
>>  list($width, $height) = getimagesize($_FILES['file']['tmp_name']);
>>  if($width && $height)
>>  {
>>  $source = imagecreatefromjpeg($_FILES['file']['tmp_name']);
>>  $dest = imagecreatetruecolor($width, $height);
>>  
>>  imagecopyresampled($dest, $source,
>>  0, 0, 0, 0,
>>  $width, $height, $width, $height);
>>  imagejpeg($dest, basename($_FILES['file']['tmp_name']));
>>  }
>>  else
>>  echo "{$_FILES['file']['name']} is not a jpeg";
>> }
>> ?>
>> 
>>  
>>  
>> 
>> 
>> Obviously it's only rough, and checks only for jpeg images, but
>that's
>> easy to alter. I've just tested this with a regular jpeg, the same
>jpeg
>> with PHP code concatenated onto the end (which still appears to be a
>> valid image to viewing/editing software) and a pure PHP file with a
>.jpg
>> extension. In the case of the first 2, a new jpeg is generated with
>the
>> same image and without the code. The third example just echoes out an
>> error.
>> 
>
>Dear Ashley, nice, but useless for this problem!
>

The problem was to do with an image upload, so no, not useless. 

>First, because users may upload other things than images! PDF's, audio
>files, videos etc!

In an earlier email I detailed some methods for validating other types, such as 
DomDocument for HTML, XML, svg, etc, or fpdf for PDF. 

And on behalf images: GD you are using handles only
>jpeg, gif and png. There are about hunderd other image types on the
>way,

At the moment those are the 3 raster formats you can use on the web, so those 
are the ones that pose an issue. If you're using anything else, it's not for 
web and doesn't need to be in a publicly accessible location. 

>users can upload! How to detect them, if the extension is missleading?

The extension comes from the user. Never trust the user, ever.

>
>And even if we succeed: As your script demonstrates very well,
>malicious
>code does not affect the rendering of the image. 

My script does effectively strip out malicious code though, even if it can't 
easily be seen.

The hacker says: Hi,
>this is a nice picture, play it, and then, please do this--follows his
>code, that can be a desaster for the whole system.

Social engineering is a whole different issue.

>
>Yes, your script seems to purge the image file, simply because GD does
>not copy the malware code. But why are you sure about that? You cannot
>see that code, OK, but may be it was executed in the plain GD
>environement? 

GD isn't a PHP parser, and PHP doesn't execute the image before GD touches it. 
Infact, Apache isn't even involved between GD and the image at that point, so 
it won't suffer from this bad config.

What you are doing is dangerous, because you force the
>execution of things that should be never executed!

Erm, no, the image isn't being executed.

>
>"no no no" forget it. After all we cannot exclude that users come in
>with malware. 

If you think it's fine that a user be able to upload malware, then you're going 
to have a very bad time.

But we MUST exclude, it is executed on the web server.

This is important too, but in this profession belt and braces is best I 
believe. 

>That is the Apache chainsaw massacre as Steward whould say. And
>probably
>it can be avoided by purging the filenames (not the files!). 
>
>Nevertheless, the standard configuration of the Apache servers is
>basically unacceptable. It must execute user requests and never ever
>user files! Period.
>
>Have nice days,
>Niklaus 
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php

Thanks,
Ash

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



Re: [PHP] Apache

2013-09-24 Thread Domain nikha . org
Tamara Temple am Montag, 23. September 2013 - 22:38:
> 
> On Sep 23, 2013, at 1:36 PM, Domain nikha.org  wrote:
> 
> > Better solutions?
> 
> One I have used, and continue to use in Apache environments, is place
uploads only in a place where they cannot be executed by turning off
such options and handlers in that directory. This is *in addition* to
untainting files and names of uploaded files.

Good idea. I will do this right now

Niklaus

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



Re: [PHP] Apache

2013-09-24 Thread Domain nikha . org
Ashley Sheridan am Montag, 23. September 2013 - 21:35:

> No, no, no! That is not a good stand-in for fundamental security
> principles!
> 
> This is a better method for ensuring an image is really an image:
> 
>  if(isset($_FILES['file']))
> {
>   list($width, $height) = getimagesize($_FILES['file']['tmp_name']);
>   if($width && $height)
>   {
>   $source = imagecreatefromjpeg($_FILES['file']['tmp_name']);
>   $dest = imagecreatetruecolor($width, $height);
>   
>   imagecopyresampled($dest, $source,
>   0, 0, 0, 0,
>   $width, $height, $width, $height);
>   imagejpeg($dest, basename($_FILES['file']['tmp_name']));
>   }
>   else
>   echo "{$_FILES['file']['name']} is not a jpeg";
> }
> ?>
> 
>   
>   
> 
> 
> Obviously it's only rough, and checks only for jpeg images, but
that's
> easy to alter. I've just tested this with a regular jpeg, the same
jpeg
> with PHP code concatenated onto the end (which still appears to be a
> valid image to viewing/editing software) and a pure PHP file with a
.jpg
> extension. In the case of the first 2, a new jpeg is generated with
the
> same image and without the code. The third example just echoes out an
> error.
> 

Dear Ashley, nice, but useless for this problem!

First, because users may upload other things than images! PDF's, audio
files, videos etc! And on behalf images: GD you are using handles only
jpeg, gif and png. There are about hunderd other image types on the way,
users can upload! How to detect them, if the extension is missleading?

And even if we succeed: As your script demonstrates very well, malicious
code does not affect the rendering of the image. The hacker says: Hi,
this is a nice picture, play it, and then, please do this--follows his
code, that can be a desaster for the whole system.

Yes, your script seems to purge the image file, simply because GD does
not copy the malware code. But why are you sure about that? You cannot
see that code, OK, but may be it was executed in the plain GD
environement? What you are doing is dangerous, because you force the
execution of things that should be never executed!

"no no no" forget it. After all we cannot exclude that users come in
with malware. But we MUST exclude, it is executed on the web server.
That is the Apache chainsaw massacre as Steward whould say. And probably
it can be avoided by purging the filenames (not the files!). 

Nevertheless, the standard configuration of the Apache servers is
basically unacceptable. It must execute user requests and never ever
user files! Period.

Have nice days,
Niklaus 

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



RE: [PHP] Apache

2013-09-24 Thread Arno Kuhl
On 23 Sep 2013, at 11:37, Domain nikha.org  wrote:

> Tamara Temple am Montag, 23. September 2013 - 06:49:
>> 
>> GoDaddy's default plesk-generated configuration for FastCGI-served 
>> PHP
> files only looked to see if the file contained ".php" somewhere on 
> it's path - i.e. it would happily execute 'malicilous.php.txt' as php 
> code, even something ridiculous like 'malware.phpnoreallyiwantthistorun'.
>> 
> 
> Yes, looks stupid.  
> But my service prodider wrote me this, I quote:
> ---QUOTE---
> This is because Apache offers features like language negotiation based 
> on extensions, too -- the final extension doesn't always just specify 
> the handler; it can specify other things. Apache can automatically 
> pick a German-language script from these, for example:
> 
> file.php.de
> file.php.en
> 
> Whether this is a good idea or not is debatable. It's possible to set 
> things up in a different way (using FilesMatch instead of AddHandler) 
> to avoid this particular problem, but that breaks other things, so 
> there's no perfect solution.
> 
> More generally, the real problem is that scripts are looking at the 
> final extension of uploaded files to decide whether they're safe or 
> not, which is dangerous. They're simply assuming that a ".gif" file 
> can't run a PHP interpreter, for example... which is usually true, but 
> certainly not always: some people run all their files through PHP.
> ---END QUOTE---

This is somewhat daft. Yes, Apache offers this feature, but you don't need
to configure it to work will all extensions. I'd be curious to know what
their issue is with using FilesMatch, since that provides a way to disable
this behaviour. And, honestly, who would have a PHP file per language? I
think it's perfectly reasonable to not allow that, because duplicating PHP
code across many files is an incredible stupid way to support multiple
languages.

"Some people run all their files through PHP" - true, but that doesn't mean
they should, or that you, as a responsible web host, should be endorsing it.

> The problem is the weak PHP upload mechanism! 
> As workaround my service provider tries to block suspicious filenames, 
> but the PHP developpers themself should work on this severe security 
> problem.

PHP developers should absolutely validate all content coming in from users
in every possible way, but I would be highly dubious about trusting a host
who gives the reason above for what I consider a lax and insecure Apache
configuration. It's like saying they sliced your arm off with their chainsaw
because it's made for cutting things, attempting to dodge all responsibility
for having swung it in your direction!

-Stuart
--

It seems this is the standard apache configuration, but that's no excuse. 
Googling returned many results where this was described as a major security
threat
e.g. "Beware of the default Apache 2 config for PHP"
http://ilia.ws/archives/226-Beware-of-the-default-Apache-2-config-for-PHP.ht
ml
On that site the solution was to change AddHandler to AddType. 
My service provider is going the FilesMatch route.

Cheers
Arno


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



Re: [PHP] Apache

2013-09-23 Thread Tamara Temple

On Sep 23, 2013, at 1:36 PM, Domain nikha.org  wrote:

> Better solutions?

One I have used, and continue to use in Apache environments, is place uploads 
only in a place where they cannot be executed by turning off such options and 
handlers in that directory. This is *in addition* to untainting files and names 
of uploaded files.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Apache

2013-09-23 Thread Ashley Sheridan
On Mon, 2013-09-23 at 20:36 +0200, Domain nikha.org wrote:

> Stuart Dallas am Montag, 23. September 2013 - 12:58:
> 
> > And, honestly, who would have a PHP file per language? I think it's
> perfectly reasonable to not allow that, because duplicating PHP code
> across many files is an incredible stupid way to support multiple
> languages.
> > 
> I agree!! Didn't even know, that this kind of faked language support
> exists...
> 
> > "Some people run all their files through PHP" - true, but that doesn't
> mean they should, or that you, as a responsible web host, should be
> endorsing it.
> > 
> > PHP developers should absolutely validate all content coming in from
> users in every possible way, but I would be highly dubious about
> trusting a host who gives the reason above for what I consider a lax and
> insecure Apache configuration. It's like saying they sliced your arm off
> with their chainsaw because it's made for cutting things, attempting to
> dodge all responsibility for having swung it in your direction!
> > 
> OK, in principle, I also agree. But this case is very easy to handle.
> I'm simply running "str_replace()" against dangerous parts of uploaded
> filenames, ".php" for instance. After that, Apache in every
> configuration will just serve, and never execute user uploaded files.
> Remains the risk on the clients side, I must concede. Better solutions?
> 
> Nice days,
> Niklaus   
> 


No, no, no! That is not a good stand-in for fundamental security
principles!

This is a better method for ensuring an image is really an image:







Obviously it's only rough, and checks only for jpeg images, but that's
easy to alter. I've just tested this with a regular jpeg, the same jpeg
with PHP code concatenated onto the end (which still appears to be a
valid image to viewing/editing software) and a pure PHP file with a .jpg
extension. In the case of the first 2, a new jpeg is generated with the
same image and without the code. The third example just echoes out an
error.


Thanks,
Ash
http://www.ashleysheridan.co.uk




Re: [PHP] Apache

2013-09-23 Thread Domain nikha . org
Stuart Dallas am Montag, 23. September 2013 - 12:58:

> And, honestly, who would have a PHP file per language? I think it's
perfectly reasonable to not allow that, because duplicating PHP code
across many files is an incredible stupid way to support multiple
languages.
> 
I agree!! Didn't even know, that this kind of faked language support
exists...

> "Some people run all their files through PHP" - true, but that doesn't
mean they should, or that you, as a responsible web host, should be
endorsing it.
> 
> PHP developers should absolutely validate all content coming in from
users in every possible way, but I would be highly dubious about
trusting a host who gives the reason above for what I consider a lax and
insecure Apache configuration. It's like saying they sliced your arm off
with their chainsaw because it's made for cutting things, attempting to
dodge all responsibility for having swung it in your direction!
> 
OK, in principle, I also agree. But this case is very easy to handle.
I'm simply running "str_replace()" against dangerous parts of uploaded
filenames, ".php" for instance. After that, Apache in every
configuration will just serve, and never execute user uploaded files.
Remains the risk on the clients side, I must concede. Better solutions?

Nice days,
Niklaus   

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



Re: [PHP] Apache

2013-09-23 Thread Stuart Dallas
On 23 Sep 2013, at 11:37, Domain nikha.org  wrote:

> Tamara Temple am Montag, 23. September 2013 - 06:49:
>> 
>> GoDaddy's default plesk-generated configuration for FastCGI-served PHP
> files only looked to see if the file contained ".php" somewhere on it's
> path - i.e. it would happily execute 'malicilous.php.txt' as php code,
> even something ridiculous like 'malware.phpnoreallyiwantthistorun'.
>> 
> 
> Yes, looks stupid.  
> But my service prodider wrote me this, I quote:
> ---QUOTE---
> This is because Apache offers features like language negotiation based
> on extensions, too -- the final extension doesn't always just specify
> the handler; it can specify other things. Apache can automatically pick
> a German-language script from these, for example:
> 
> file.php.de
> file.php.en
> 
> Whether this is a good idea or not is debatable. It's possible to set
> things up in a different way (using FilesMatch instead of AddHandler)
> to
> avoid this particular problem, but that breaks other things, so there's
> no perfect solution.
> 
> More generally, the real problem is that scripts are looking at the
> final extension of uploaded files to decide whether they're safe or
> not,
> which is dangerous. They're simply assuming that a ".gif" file can't
> run
> a PHP interpreter, for example... which is usually true, but certainly
> not always: some people run all their files through PHP.
> ---END QUOTE---

This is somewhat daft. Yes, Apache offers this feature, but you don't need to 
configure it to work will all extensions. I'd be curious to know what their 
issue is with using FilesMatch, since that provides a way to disable this 
behaviour. And, honestly, who would have a PHP file per language? I think it's 
perfectly reasonable to not allow that, because duplicating PHP code across 
many files is an incredible stupid way to support multiple languages.

"Some people run all their files through PHP" - true, but that doesn't mean 
they should, or that you, as a responsible web host, should be endorsing it.

> The problem is the weak PHP upload mechanism! 
> As workaround my service provider tries to block suspicious filenames,
> but the PHP developpers themself should work on this severe security
> problem.

PHP developers should absolutely validate all content coming in from users in 
every possible way, but I would be highly dubious about trusting a host who 
gives the reason above for what I consider a lax and insecure Apache 
configuration. It's like saying they sliced your arm off with their chainsaw 
because it's made for cutting things, attempting to dodge all responsibility 
for having swung it in your direction!

-Stuart

-- 
Stuart Dallas
3ft9 Ltd
http://3ft9.com/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Apache

2013-09-23 Thread Domain nikha . org
Tamara Temple am Montag, 23. September 2013 - 06:49:
> 
> GoDaddy's default plesk-generated configuration for FastCGI-served PHP
files only looked to see if the file contained ".php" somewhere on it's
path - i.e. it would happily execute 'malicilous.php.txt' as php code,
even something ridiculous like 'malware.phpnoreallyiwantthistorun'.
> 

Yes, looks stupid.  
But my service prodider wrote me this, I quote:
---QUOTE---
This is because Apache offers features like language negotiation based
on extensions, too -- the final extension doesn't always just specify
the handler; it can specify other things. Apache can automatically pick
a German-language script from these, for example:

 file.php.de
 file.php.en

Whether this is a good idea or not is debatable. It's possible to set
things up in a different way (using FilesMatch instead of AddHandler)
to
avoid this particular problem, but that breaks other things, so there's
no perfect solution.

More generally, the real problem is that scripts are looking at the
final extension of uploaded files to decide whether they're safe or
not,
which is dangerous. They're simply assuming that a ".gif" file can't
run
a PHP interpreter, for example... which is usually true, but certainly
not always: some people run all their files through PHP.
---END QUOTE---

The problem is the weak PHP upload mechanism! 
As workaround my service provider tries to block suspicious filenames,
but the PHP developpers themself should work on this severe security
problem.

Niklaus
 

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



RE: [PHP] Apache

2013-09-20 Thread Domain nikha . org
Hi Arno!
Seems to be the standard behaviour of Apache servers all over the
world!

I was testing this way:

First I renamed a real, proper GIF-file to "this.php.nice.gif", put it
in the root of my websites and called it with the browser. Result:
"Error 500 Internal Server Error". The logfile tells: "Premature end of
script headers: this.php.nice.gif".

Then I did infect the same GIF-file with some PHP-Code (), renamed it to "this.php.evel.gif", put it in the
root, called it with the browser. The result was exactly the same: Error
500, Premature end of script headers.

That means, wether the file is infected or not, it IS passed to the PHP
interpreter only because it contains somewehere ".php" in his name!

Then I renamed a real PHP script to "test.php.gif". This finaly produced
the following response from my web hoster:

_QUOTE_  
Files with Extra ".php." Extension
If you were directed to this page, you probably tried viewing a file
that contains .php. in its name,   such as image.php.jpeg or image.php.
(note the extra dot at the end).
The site you were visiting uses the Apache Web server, which will
usually attempt to run such files as PHP scripts (instead of allowing
your browser to display them as images, or completely failing to run
them, as you'd probably expect).
Allowing those files to run as a PHP script is a security vulnerability,
as seen in exploits for WordPress and Joomla. Because of that, we block
requests to these files.
If you’re the owner of this site and you want to use a real image that
includes “.php.” as part of the name, please rename the file.
_END QUOTE_

Sounds reasonable. And means, you really must protect your uploadings.
A simple way:
$filename = str_replace('.php', '', $_FILES['userfile']['name']);
move_uploaded_file($_FILES['userfile']['tmp_name'],
'yourdirectory/'.$filename);

Hope, this helps,
Niklaus


Arno Kuhl am Donnerstag, 19. September 2013 - 16:14:
> Arno: If you can request that file using a web browser, and it gets
executed
> as PHP on your server then there is an error in the Apache
configuration.
> 
> Easy test: create a file in a text editor containing some PHP ( phpinfo(); ?> would be enough) and upload it to the www root of your
site
> and name it test.pgif. Then hit http://www.yourdomain.com/test.pgif in
your
> browser. If you see the PHP code or an error then you're fine. If you
see
> PHP's info page then you need to change web host as quickly as
possible. I
> don't care if they fix it - the fact their server was configured to do
this
> by default is enough for me to never trust them again.
> 
> -Stuart
> --
> 
> Thanks Stuart. I just tried it now, test.php.pgif displayed the info
while
> test.xyz.pgif returned the content, confirming the problem. My
service
> provider finally conceded the problem is on their side and are looking
for
> an urgent fix, much too complicated to consider moving service
providers in
> the short term.
> 
> As a side note, the sp said the issue is new and coincided with an
upgrade
> to fastcgi recently, I wonder if the hacker was exploiting a known
issue
> with that scenario?
> 
> Cheers
> Arno
> 
>

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



Re: [PHP] Apache to serve RESTful requests using PHP

2013-02-11 Thread Stuart Dallas
On 10 Feb 2013, at 06:57, AmirBehzad Eslami  wrote:

> Stuart, thanks for your detailed response.
> 
> >>  I find it unlikely that Apache is your bottleneck,
> >> especially with a service involving MySQL. 
> >> How have you come to this conclusion?
> 
> Apache is the entry-point to our service, and I did a 
> benchmark with AB to see how it can handle concurrent
> requests in a timely fashion.  After a number of 50 concurrent
> requests, the average "time per request" reached from less than
> a second to 5 seconds.

I *strongly* recommend you try the same test with nginx. Unless this is due to 
the way your code works I'm confident you'll see this effect disappear!

> >> As far as keep-alive goes, how frequently will individual
> >> clients be accessing the service?
> 
> There are only "a few" clients that call the service.  These clients
> are PHP-driven web pages. Each page has its own unique ClickID
> and a set of other unique parameters per user visit.  These pages send these 
> parameters to the service using php-curl, and expect a generated
> response to be returned.  That's why I'm saying each request and
> response is unique.
> 
> Whenever a user visits a web-page, there would be a call to the
> web-service.  At the moment, we don't know number of concurrent
> visits.  We're looking for a way to figure that out in Apache.
> 
> Is there a way to see if the requests are using the previously keep-alived
> http channel?  Because same client will send requests to the service,
> and I'm curious to know if the Apache will allocate the already-opened
> channel, or will create a new one?

If it's making one request to your service per page request, keep-alive is 
pointless as it won't be able to reuse the connection. In this instance I would 
turn keep-alive off.

> >> If you are using joins to pull in extra data (i.e. IDs to a name
> >> or similar) look at using Memcache for those, but make sure
> >> that when they're updated in the DB they're also updated in Memcache. 
> 
> Memcache or Redis, I'm going to add a caching layer between
> MySQL and PHP, to store the de-normilized data.

For simple caching I'd recommend Memcache over Redis, purely because Redis is 
more complex due to its support for sets, queues and other very useful stuff. 
The only reason I'd use Redis for simple caching is because it can periodically 
flush the cache to disk so if it has to restart it can start with a primed 
cache. However, in most cases that is not a huge advantage.

If each request and response is unique you need to be careful about what you 
choose to cache such that you don't incur caching costs without reaping 
benefits that make it worthwhile.

-Stuart

-- 
Stuart Dallas
3ft9 Ltd
http://3ft9.com/

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



Re: [PHP] Apache to serve RESTful requests using PHP

2013-02-09 Thread AmirBehzad Eslami
Stuart, thanks for your detailed response.

>>  I find it unlikely that Apache is your bottleneck,
>> especially with a service involving MySQL.
>> How have you come to this conclusion?

Apache is the entry-point to our service, and I did a
benchmark with AB to see how it can handle concurrent
requests in a timely fashion.  After a number of 50 concurrent
requests, the average "time per request" reached from less than
a second to 5 seconds.

On the other hand, the MySQL's slow_query_log was clear,
with long_query_time = 1.

Our MySQL database consists of less than 200 records,
distributed in normalized tables, yes, queries are making joins,
but the overall performance is OK.

>> As far as keep-alive goes, how frequently will individual
>> clients be accessing the service?

There are only "a few" clients that call the service.  These clients
are PHP-driven web pages. Each page has its own unique ClickID
and a set of other unique parameters per user visit.  These pages send
these parameters to the service using php-curl, and expect a generated
response to be returned.  That's why I'm saying each request and
response is unique.

Whenever a user visits a web-page, there would be a call to the
web-service.  At the moment, we don't know number of concurrent
visits.  We're looking for a way to figure that out in Apache.

Is there a way to see if the requests are using the previously keep-alived
http channel?  Because same client will send requests to the service,
and I'm curious to know if the Apache will allocate the already-opened
channel, or will create a new one?

>> If you are using joins to pull in extra data (i.e. IDs to a name
>> or similar) look at using Memcache for those, but make sure
>> that when they're updated in the DB they're also updated in Memcache.

Memcache or Redis, I'm going to add a caching layer between
MySQL and PHP, to store the de-normilized data.

I'm starting to learn more about nginx + php-fpm, thanks for
sharing your positive experience about this.

-behzad


Re: [PHP] Apache to serve RESTful requests using PHP

2013-02-09 Thread tamouse mailing lists
On Sat, Feb 9, 2013 at 12:21 PM, Stuart Dallas  wrote:
> On 9 Feb 2013, at 16:42, AmirBehzad Eslami  wrote:
>> We're a developing a PHP-driven web service with a RESTful API,
>> and we have a dedicated Linux server for that with 6GB of RAM.

> I would personally recommend nginx + php-fpm over Apache + mod-php every 
> time. The pre-request memory footprint is massively reduced and I've seen 
> nothing but upsides since migrating most of my client's sites, and my own.

+1 for nginx+php-fpm - the memory savings on this are incredible;
while I keep using Apache as a general purpose server, nginx+php-fpm
is really ideal for large scale php applications.

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



Re: [PHP] Apache to serve RESTful requests using PHP

2013-02-09 Thread Stuart Dallas
On 9 Feb 2013, at 16:42, AmirBehzad Eslami  wrote:

> We're a developing a PHP-driven web service with a RESTful API,
> and we have a dedicated Linux server for that with 6GB of RAM.
> 
> Since this service will be used by many clients in a concurrent
> manner,  we'll face with a high-load on our web-server.  But
> web-services are different from web pages, for instance they
> don't include images, or in this case we only serve JSON.
> 
> I'm wondering what are the recommended configurations for
> the Apache web-server in these situations?  Should we disable
> keep-avlie?  What about other directives?  Apache is our
> bottleneck, and we're trying to optimize it. Should we use nginx instead?

I find it unlikely that Apache is your bottleneck, especially with a service 
involving MySQL. How have you come to this conclusion?

I would personally recommend nginx + php-fpm over Apache + mod-php every time. 
The pre-request memory footprint is massively reduced and I've seen nothing but 
upsides since migrating most of my client's sites, and my own.

As far as keep-alive goes, how frequently will individual clients be accessing 
the service? Are they likely to be using client software that supports 
keep-alive? You basically want to weigh up the cost of potentially keeping the 
connection open against the likelihood that the majority of clients will make 
use of it for multiple requests. My gut reaction based on your description 
would be to set it to 1 as suggested by Bastien so it has minimal impact while 
still allowing clients who support it to be that bit more efficient.

Focus your optimisation efforts on MySQL. If the bulk of requests will be reads 
you'll benefit from read-only slaves. If the data can be neatly sharded then 
that's definitely worth investigating. When writing data get it as close to the 
structure that will be needed when reading, including de-normalising it if 
necessary.

If you are using joins to pull in extra data (i.e. IDs to a name or similar) 
look at using Memcache for those, but make sure that when they're updated in 
the DB they're also updated in Memcache. Do the DB query, get all the Memcache 
keys you need a do a multi-get request. The other way to do this is to 
de-normalise as discussed above, but that makes updating the data very 
expensive (as every row needs to be updated). In my tests breaking it out to a 
Memcache instance was far more efficient.

At the end of the day there will always be things you can do that are only 
applicable to your service, but the general rule is to need to do as little as 
possible to serve the data when it's requested, shifting as much of the work as 
possible to when it is written (assuming a mostly-read service).

-Stuart

-- 
Stuart Dallas
3ft9 Ltd
http://3ft9.com/

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



Re: [PHP] Apache to serve RESTful requests using PHP

2013-02-09 Thread AmirBehzad Eslami
Bastein,

Response is unique per request, and not cachable.  The app
fetches records from MySQL (say, templates), performs a
process on them, and returns the generated output as JSON.

We were thinking to use Redis to reduce queries against
MySQL, but still Apache will remain as our bottleneck.

On Sun, Feb 10, 2013 at 1:00 AM, Bastien  wrote:

>
>
> Bastien Koert
>
> On 2013-02-09, at 11:42 AM, AmirBehzad Eslami 
> wrote:
>
> > Dear list,
> >
> > We're a developing a PHP-driven web service with a RESTful API,
> > and we have a dedicated Linux server for that with 6GB of RAM.
> >
> > Since this service will be used by many clients in a concurrent
> > manner,  we'll face with a high-load on our web-server.  But
> > web-services are different from web pages, for instance they
> > don't include images, or in this case we only serve JSON.
> >
> > I'm wondering what are the recommended configurations for
> > the Apache web-server in these situations?  Should we disable
> > keep-avlie?  What about other directives?  Apache is our
> > bottleneck, and we're trying to optimize it. Should we use nginx instead?
> >
> > Please let me know your suggestions.
> >
> > Thank you,
> > -behzad
>
> How much of that data is cachable? You're likely to get bigger performance
> gains from caching frequent data.
>
> Keep-alive at maybe 1 second.
>
> But would need to know more about the app to be able to suggest more
>
> Bastien


Re: [PHP] Apache to serve RESTful requests using PHP

2013-02-09 Thread Bastien


Bastien Koert

On 2013-02-09, at 11:42 AM, AmirBehzad Eslami  wrote:

> Dear list,
> 
> We're a developing a PHP-driven web service with a RESTful API,
> and we have a dedicated Linux server for that with 6GB of RAM.
> 
> Since this service will be used by many clients in a concurrent
> manner,  we'll face with a high-load on our web-server.  But
> web-services are different from web pages, for instance they
> don't include images, or in this case we only serve JSON.
> 
> I'm wondering what are the recommended configurations for
> the Apache web-server in these situations?  Should we disable
> keep-avlie?  What about other directives?  Apache is our
> bottleneck, and we're trying to optimize it. Should we use nginx instead?
> 
> Please let me know your suggestions.
> 
> Thank you,
> -behzad

How much of that data is cachable? You're likely to get bigger performance 
gains from caching frequent data.

Keep-alive at maybe 1 second. 

But would need to know more about the app to be able to suggest more

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



[PHP] Apache to serve RESTful requests using PHP

2013-02-09 Thread AmirBehzad Eslami
Dear list,

We're a developing a PHP-driven web service with a RESTful API,
and we have a dedicated Linux server for that with 6GB of RAM.

Since this service will be used by many clients in a concurrent
manner,  we'll face with a high-load on our web-server.  But
web-services are different from web pages, for instance they
don't include images, or in this case we only serve JSON.

I'm wondering what are the recommended configurations for
the Apache web-server in these situations?  Should we disable
keep-avlie?  What about other directives?  Apache is our
bottleneck, and we're trying to optimize it. Should we use nginx instead?

Please let me know your suggestions.

Thank you,
-behzad


[PHP] crash dump on OS X Server: PHP / Apache

2012-10-09 Thread Mattias Thorslund

Perhaps someone can read this backtrace.

This is a problem that causes Apache to not send any output at all. 
Doing a die() just before one particular require_once prevents the 
issue. If I move that die() into the required file and place it just 
after the opening PHP tag, I get the error again. I have verified the 
PHP syntax of this file with php -l .


This site uses CodeIgniter and FileMaker's PHP API, and the include file 
where this happens is one of the API files. The PHP library is the one 
supplied by FileMaker 12 Advanced Server. Another PHP application on the 
same server, using the same FileMaker API is running just fine, but that 
one isn't using CodeIgniter.


Any insight would be greatly appreciated.

Mattias

Process: httpd [9018]
Path:/usr/sbin/httpd
Identifier:  httpd
Version: ??? (???)
Code Type:   X86-64 (Native)
Parent Process:  httpd [7101]

Date/Time:   2012-10-09 17:57:11.216 -0700
OS Version:  Mac OS X Server 10.6.8 (10K549)
Report Version:  6

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x
Crashed Thread:  0  Dispatch queue: com.apple.main-thread

Thread 0 Crashed:  Dispatch queue: com.apple.main-thread
0   libphp5.so  0x00010131fe1c _zend_mm_alloc_int + 
924
1   libphp5.so  0x000101332d4b init_op_array + 113
2   libphp5.so  0x000101319be7 compile_file + 218
3   libphp5.so  0x000101196ec1 phar_compile_file + 
844
4   libphp5.so  0x00010131923b compile_filename + 
190
5   libphp5.so  0x00010136925d 
ZEND_INCLUDE_OR_EVAL_SPEC_TMP_HANDLER + 714
6   libphp5.so  0x00010135f6b9 execute + 585
7   libphp5.so  0x000101330f7c zend_call_function + 
2223
8   libphp5.so  0x00010133199a 
call_user_function_ex + 76
9   libphp5.so  0x00010133b856 zend_error + 1794
10  libphp5.so  0x00010130e216 zendparse + 8810
11  libphp5.so  0x000101319bfb compile_file + 238
12  libphp5.so  0x000101196ec1 phar_compile_file + 
844
13  libphp5.so  0x0001013691d8 
ZEND_INCLUDE_OR_EVAL_SPEC_TMP_HANDLER + 581
14  libphp5.so  0x00010135f6b9 execute + 585
15  libphp5.so  0x000101330f7c zend_call_function + 
2223
16  libphp5.so  0x000101261feb 
zif_call_user_func_array + 111
17  libphp5.so  0x0001013600ab 
zend_do_fcall_common_helper_SPEC + 2401
18  libphp5.so  0x00010135f6b9 execute + 585
19  libphp5.so  0x00010133a8c4 zend_execute_scripts 
+ 376
20  libphp5.so  0x0001012ebf95 php_execute_script + 
732
21  libphp5.so  0x0001013b7612 php_handler + 1237
22  httpd   0x000112cf ap_run_handler + 90
23  httpd   0x00011bc8 ap_invoke_handler + 
354
24  httpd   0x00010002ebd0 ap_process_request + 
103
25  httpd   0x00010002b3b4 
ap_process_http_connection + 116
26  httpd   0x0001000128ac 
ap_run_process_connection + 90
27  httpd   0x000100012d7a 
ap_process_connection + 91
28  httpd   0x000100035fbe child_main + 1257
29  httpd   0x00010003617d make_child + 329
30  httpd   0x000100036403 
perform_idle_server_maintenance + 498
31  httpd   0x00010003692d ap_mpm_run + 1246
32  httpd   0x000198f4 main + 2868
33  httpd   0x00010934 start + 52

Thread 0 crashed with X86 Thread State (64-bit):
  rax: 0x  rbx: 0x000d  rcx: 0x  
rdx: 0x0359
  rdi: 0x0002  rsi: 0x000101d00950  rbp: 0x7fff5fbfc3f0  
rsp: 0x7fff5fbfc3b0
   r8: 0x00010087f8f0   r9: 0x000c  r10: 0x0001  
r11: 0x000101d6c5b0
  r12: 0x000101d00928  r13: 0x000101d00928  r14: 0x00010087f200  
r15: 0x1e10
  rip: 0x00010131fe1c  rfl: 0x0206  cr2: 0x

Binary Images:
   0x1 -0x10004bfe7 +httpd ??? (???) 
<36669387-22E7-3D70-2384-46243282B4CC> /usr/sbin/httpd
   0x10007f000 -0x1000a7ff7  libpcre.0.dylib 1.1.0 (compatibility 1.0.0) 
<61E04B84-398D-0E87-7125-A668E797DE77> /usr/lib/libpcre.0.dylib
   0x1000ac000 -0x1000c4fe7  libaprutil-1.0.dylib 4.9.0 (compatibility 
4.0.0)  /usr/l

Re: [PHP] Apache 2.4.1 and php?

2012-02-24 Thread Daniel Fenn
Hey guys,

Thank-you for getting back to me. Considering that I'm building
everything again from the ground up, I think I will make the change
from running mod_php and go for a fastcgi setup.

My only other question is, if I go with fastcgi will it work with
accelerators such as APC and xcache? I heard that some setup doesn't
work well with accelerators because of the fact the cache get cleared
when php is not running.

Regards,
Daniel Fenn







On Fri, Feb 24, 2012 at 9:51 PM, German Geek  wrote:
> Hi Daniel,
>
> You should be able to. Haven't tried it with that specific version, but
> generally PHP is designed to run with any version of Apache. If it doesn't
> work as a module you should always be able to compile it as a fastcgi
> application and that should work. Then you can even setup different users to
> run PHP, making it more controllable security-wise.
>
> Cheers,
> Tim
>
> Twitter: @timhheuer
> Blog: http://www.thheuer.com
>
>
>
> On Fri, Feb 24, 2012 at 10:24 PM, Fatih P.  wrote:
>>
>> On Fri, Feb 24, 2012 at 3:58 AM, Daniel Fenn  wrote:
>>
>> > Hi,
>> >
>> > Just a quick question, will I be able to run Apache 2.4.1 and php
>> > 5.3.10 together? Or will I need to wait for php to be updated? I'm
>> > setting this up on CentOs 6.2
>> >
>> > Regards,
>> > Daniel Fenn
>> >
>> > --
>> > PHP General Mailing List (http://www.php.net/)
>> > To unsubscribe, visit: http://www.php.net/unsub.php
>> >
>> >
>> you can run both. make sure you have proper configuration for each
>
>

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



Re: [PHP] Apache 2.4.1 and php?

2012-02-24 Thread German Geek
Hi Daniel,

You should be able to. Haven't tried it with that specific version, but
generally PHP is designed to run with any version of Apache. If it doesn't
work as a module you should always be able to compile it as a fastcgi
application and that should work. Then you can even setup different users
to run PHP, making it more controllable security-wise.

Cheers,
Tim

Twitter: @timhheuer
Blog: http://www.thheuer.com



On Fri, Feb 24, 2012 at 10:24 PM, Fatih P.  wrote:

> On Fri, Feb 24, 2012 at 3:58 AM, Daniel Fenn  wrote:
>
> > Hi,
> >
> > Just a quick question, will I be able to run Apache 2.4.1 and php
> > 5.3.10 together? Or will I need to wait for php to be updated? I'm
> > setting this up on CentOs 6.2
> >
> > Regards,
> > Daniel Fenn
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> you can run both. make sure you have proper configuration for each
>


Re: [PHP] Apache 2.4.1 and php?

2012-02-24 Thread Fatih P.
On Fri, Feb 24, 2012 at 3:58 AM, Daniel Fenn  wrote:

> Hi,
>
> Just a quick question, will I be able to run Apache 2.4.1 and php
> 5.3.10 together? Or will I need to wait for php to be updated? I'm
> setting this up on CentOs 6.2
>
> Regards,
> Daniel Fenn
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
you can run both. make sure you have proper configuration for each


[PHP] Apache 2.4.1 and php?

2012-02-23 Thread Daniel Fenn
Hi,

Just a quick question, will I be able to run Apache 2.4.1 and php
5.3.10 together? Or will I need to wait for php to be updated? I'm
setting this up on CentOs 6.2

Regards,
Daniel Fenn

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



[PHP] Apache 2.4.1 and php?

2012-02-23 Thread Daniel Fenn
Just a quick question, will I be able to run Apache 2.4.1 and php
5.3.10 together? Or will I need to wait for php to be updated? I'm
setting this up on CentOs 6.2

Regards,

Daniel Fenn

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



[PHP] apache or php limit?

2011-05-30 Thread Peet Grobler
Hi there, new to this list.

I have a problem I can't seem to figure out. Here goes.

PHP page has 100s of textboxes on it. Submit on the development machine,
everything works as expected. Submit on live machine - only part of the
$_POST variables are there. The script doesn't stop executing - it
executes just fine with the limited data.

I've checked:
- post_max_size - more than enough (8M). Increased to 512M and
  re-tested, this is definately not the problem.
- memory_limit - same thing (increased from 128M to 512M)
- apache2.conf is the same on both hosts (except for ServerName,
  etc.
- php.ini is the same on both machines (except for debugging information
  turned on on development machine).
- I enabled debugging and logging on the live machine, but there's
  nothing in the logs.

Can anyone point me in any direction please. It boggles the mind that
the exact same script works fine on one machine, but not the other,
given that apache and php configs are the same.

flu:~# apache2 -v
Server version: Apache/2.2.16 (Debian)
Server built:   Mar 22 2011 20:56:31
flu:~# php -v
PHP 5.3.3-7+squeeze1 with Suhosin-Patch (cli) (built: Mar 18 2011 17:22:52)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
with Suhosin v0.9.32.1, Copyright (c) 2007-2010, by SektionEins GmbH
flu:~# cat /proc/version
Linux version 2.6.26-2-686 (Debian 2.6.26-26lenny1) (da...@debian.org)
(gcc version 4.1.3 20080704 (prerelease) (Debian 4.1.2-25)) #1 SMP Thu
Nov 25 01:53:57 UTC 2010
flu:~#


If this is the wrong place to ask please point me in some direction.

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



Re: [PHP] Apache and PHP segfaults on Redhat EL5

2011-01-07 Thread Greg Bair
On Fri, 7 Jan 2011 16:24:13 -0500
Daniel Brown  wrote:

> On Thu, Jan 6, 2011 at 22:55, Jimmy Stewpot 
> wrote:
> >
> > Is there a method or way that I can enable a 'debug' mode in php
> > which would help me track down and identify the root cause of these
> > problems? If anyone has any suggestions on what I can do to try and
> > get further down the track to enlightenment I would be really
> > appreciated.
> 
> Natively, no, but the de facto standard is Derick's Xdebug package
> (http://xdebug.org/).  If you can, compile PHP from source and do away
> with the EL5 package.  That'll most likely rid you of the segfaults,
> but will leave their cause as an unsolved mystery.  If you're okay
> with giving up and not knowing, you'll probably save yourself a lot of
> time and headaches.
> 

Also, you might try asking on a RH list or forum, this might be a known
issue with a workaround.  If all else fails, file a bug.

-- 
Greg Bair
PHP Developer

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



Re: [PHP] Apache and PHP segfaults on Redhat EL5

2011-01-07 Thread Daniel Brown
On Thu, Jan 6, 2011 at 22:55, Jimmy Stewpot  wrote:
>
> Is there a method or way that I can enable a 'debug' mode in php which would 
> help me track down and identify the root cause of these problems?
> If anyone has any suggestions on what I can do to try and get further down 
> the track to enlightenment I would be really appreciated.

Natively, no, but the de facto standard is Derick's Xdebug package
(http://xdebug.org/).  If you can, compile PHP from source and do away
with the EL5 package.  That'll most likely rid you of the segfaults,
but will leave their cause as an unsolved mystery.  If you're okay
with giving up and not knowing, you'll probably save yourself a lot of
time and headaches.

-- 

Network Infrastructure Manager
Documentation, Webmaster Teams
http://www.php.net/

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



[PHP] Apache and PHP segfaults on Redhat EL5

2011-01-06 Thread Jimmy Stewpot
Hello,

I have been working over the last few months to try and get to the bottom of 
why our apache processes are regularly being killed with a Sig 11 (Segmentation 
Fault). Here are the messages in the kern.log

httpd[22309]: segfault at 7fffd01b4ffc rip 2b1f935c064c rsp 
7fffd01b4f90 error 6
httpd[21819]: segfault at 7fffd01b4ffc rip 2b1f935c064c rsp 
7fffd01b4f90 error 6
httpd[19168]: segfault at 7fffd01b4ffc rip 2b1f935c064c rsp 
7fffd01b4f90 error 6
httpd[21597]: segfault at 7fffd01b4ffc rip 2b1f935c064c rsp 
7fffd01b4f90 error 6
httpd[22871]: segfault at 7fffd01b4ffc rip 2b1f935c064c rsp 
7fffd01b4f90 error 6
httpd[22090]: segfault at 7fffd01b4ffc rip 2b1f935c064c rsp 
7fffd01b4f90 error 6
httpd[21970]: segfault at 7fffd01b4ffc rip 2b1f935c064c rsp 
7fffd01b4f90 error 6
httpd[22315]: segfault at 7fffd01b4ffc rip 2b1f935c064c rsp 
7fffd01b4f90 error 6
httpd[21808]: segfault at 7fffd01b4ffc rip 2b1f935c064c rsp 
7fffd01b4f90 error 6
httpd[21801]: segfault at 7fffd01b4ffc rip 2b1f935c064c rsp 
7fffd01b4f90 error 6
httpd[20469]: segfault at 7fffd01b4ffc rip 2b1f935c064c rsp 
7fffd01b4f90 error 6
httpd[23509]: segfault at 7fffd01b4ffc rip 2b1f935c064c rsp 
7fffd01b4f90 error 6
httpd[21967]: segfault at 7fffd01b4ffc rip 2b1f935c064c rsp 
7fffd01b4f90 error 6
httpd[21814]: segfault at 7fffd01b4ffc rip 2b1f935c064c rsp 
7fffd01b4f90 error 6
httpd[24017]: segfault at 7fffd01b4ffc rip 2b1f935c064c rsp 
7fffd01b4f90 error 6
httpd[21605]: segfault at 7fffd01b4ffc rip 2b1f935c064c rsp 
7fffd01b4f90 error 6
httpd[24329]: segfault at 7fffd01b4ffc rip 2b1f935c064c rsp 
7fffd01b4f90 error 6
httpd[23573]: segfault at 7fffd01b4ffc rip 2b1f935c064c rsp 
7fffd01b4f90 error 6
httpd[24328]: segfault at 7fffd01b4ffc rip 2b1f935c064c rsp 
7fffd01b4f90 error 6
httpd[22301]: segfault at 7fffd01b4ffc rip 2b1f935c064c rsp 
7fffd01b4f90 error 6
httpd[24636]: segfault at 7fffd01b4ffc rip 2b1f935c064c rsp 
7fffd01b4f90 error 6
httpd[25028]: segfault at 7fffd01b4ffc rip 2b1f935c064c rsp 
7fffd01b4f90 error 6
httpd[22869]: segfault at 7fffd01b4ffc rip 2b1f935c064c rsp 
7fffd01b4f90 error 6
httpd[25030]: segfault at 7fffd01b4ffc rip 2b1f935c064c rsp 
7fffd01b4f90 error 6


We literally have thousands of those, I have tracked it down as far as being 
caused by mod_php in apache (Redhat 5 update 5). However when I enabled 
coredump's in apache I don't get anything. I can however get a dump if I send a 
manual sig 11 to the process. Which brings me to my questions.

Is there a method or way that I can enable a 'debug' mode in php which would 
help me track down and identify the root cause of these problems?
If anyone has any suggestions on what I can do to try and get further down the 
track to enlightenment I would be really appreciated.

Regards,

Jimmy. 

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



Re: [PHP] Apache mod_pagespeed

2010-11-03 Thread Jim Jagielski
They are doing a preso about it @ ApacheCon.

On Wed, Nov 03, 2010 at 03:34:01PM -0400, Daniel P. Brown wrote:
> On Wed, Nov 3, 2010 at 14:48, Shreyas Agasthya  wrote:
> > Thiago,
> >
> > I would like to join this. Let me know how I can help you with this. Please
> > be explicit with your requests so that we can totally test it ?and see if it
> > could pose any risk to acceleration services provided by CDNs.
> 
> I've yet to read the specs behind it (I was out of the office),
> but from the overview I did see, it should not only be of no detriment
> to CDNs.  In fact, Google is working with an existing company,
> Cotendo, to integrate the core into their CDN.
> 
> -- 
> 
> Dedicated Servers, Cloud and Cloud Hybrid Solutions, VPS, Hosting
> (866-) 725-4321
> http://www.parasane.net/
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

-- 
===
   Jim Jagielski   [|]   j...@jagunet.com   [|]   http://www.jaguNET.com/
"Great is the guilt of an unnecessary war"  ~ John Adams

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



Re: [PHP] Apache mod_pagespeed

2010-11-03 Thread Daniel P. Brown
On Wed, Nov 3, 2010 at 14:48, Shreyas Agasthya  wrote:
> Thiago,
>
> I would like to join this. Let me know how I can help you with this. Please
> be explicit with your requests so that we can totally test it  and see if it
> could pose any risk to acceleration services provided by CDNs.

I've yet to read the specs behind it (I was out of the office),
but from the overview I did see, it should not only be of no detriment
to CDNs.  In fact, Google is working with an existing company,
Cotendo, to integrate the core into their CDN.

-- 

Dedicated Servers, Cloud and Cloud Hybrid Solutions, VPS, Hosting
(866-) 725-4321
http://www.parasane.net/

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



Re: [PHP] Apache mod_pagespeed

2010-11-03 Thread Shreyas Agasthya
Thiago,

I would like to join this. Let me know how I can help you with this. Please
be explicit with your requests so that we can totally test it  and see if it
could pose any risk to acceleration services provided by CDNs.

Regards,
Shreyas

On Wed, Nov 3, 2010 at 11:51 PM, Thiago H. Pojda wrote:

> Guys,
>
> Google announced this
> morning<
> http://googlewebmastercentral.blogspot.com/2010/11/make-your-websites-run-faster.html
> >their
> mod_pagespeed 
> to
> improve Apache's performance. It really looks promising, what do you guys
> think?
>
> Me and Daniel Brown will be running some tests with it, let us know if
> you'd
> like to join us. :)
>
> Google mentions 2x faster loading times, but they don't mention CPU cost.
>
> What do you think it will break?
>
>
> Cheers,
> Thiago Henrique Pojda
> +55 41 8856-7925
>



-- 
Regards,
Shreyas Agasthya


[PHP] Apache mod_pagespeed

2010-11-03 Thread Thiago H. Pojda
Guys,

Google announced this
morningtheir
mod_pagespeed  to
improve Apache's performance. It really looks promising, what do you guys
think?

Me and Daniel Brown will be running some tests with it, let us know if you'd
like to join us. :)

Google mentions 2x faster loading times, but they don't mention CPU cost.

What do you think it will break?


Cheers,
Thiago Henrique Pojda
+55 41 8856-7925


[PHP] php apache module before read a file recursively scan full path

2010-06-14 Thread Vincenzo D'Amore
Hello,

I have performance problems during execution of php code.
With strace I have recorded system calls which are called by apache httpd
and what I have is quite singular.
It seems that php apache module before read file recursively scan with lstat
all the path (please also see attached file).
If you take a look at attached file, it is also odd because there are many
tries before read the file.
Is there somebody that could help me to understand why I have this behavior?


lstat("/usr", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat("/usr/local", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat("/usr/local/sitipersonali", {st_mode=S_IFDIR|0755, st_size=4096, ...})
= 0
lstat("/usr/local/sitipersonali/disco4_ml", {st_mode=S_IFDIR|0755,
st_size=3072, ...}) = 0
lstat("/usr/local/sitipersonali/disco4_ml/NSP", {st_mode=S_IFDIR|0755,
st_size=2048, ...}) = 0
lstat("/usr/local/sitipersonali/disco4_ml/NSP/la", {st_mode=S_IFDIR|0755,
st_size=80, ...}) = 0
lstat("/usr/local/sitipersonali/disco4_ml/NSP/la/av", {st_mode=S_IFDIR|0755,
st_size=80, ...}) = 0
lstat("/usr/local/sitipersonali/disco4_ml/NSP/la/av/lavoro",
{st_mode=S_IFDIR|0755, st_size=1024, ...}) = 0
lstat("/usr/local/sitipersonali/disco4_ml/NSP/la/av/lavoro/webspace",
{st_mode=S_IFDIR|0755, st_size=1024, ...}) = 0
lstat("/usr/local/sitipersonali/disco4_ml/NSP/la/av/lavoro/webspace/httpdocs",
{st_mode=S_IFDIR|0750, st_size=2048, ...}) = 0
lstat("/usr/local/sitipersonali/disco4_ml/NSP/la/av/lavoro/webspace/httpdocs/wp-includes",
{st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat("/usr/local/sitipersonali/disco4_ml/NSP/la/av/lavoro/webspace/httpdocs/wp-includes/feed-rss2.php",
{st_mode=S_IFREG|0644, st_size=2513, ...}) = 0

Best regards,
Vincenzo D'Amore



-- 
Vincenzo D'Amore
email: v.dam...@gmail.com
msn: free...@hotmail.com
skype: free.dev
mobile: +39 349 8513251
lstat("/usr", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat("/usr/local", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat("/usr/local/sitipersonali", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat("/usr/local/sitipersonali/disco4_ml", {st_mode=S_IFDIR|0755, 
st_size=3072, ...}) = 0
lstat("/usr/local/sitipersonali/disco4_ml/NSP", {st_mode=S_IFDIR|0755, 
st_size=2048, ...}) = 0
lstat("/usr/local/sitipersonali/disco4_ml/NSP/la", {st_mode=S_IFDIR|0755, 
st_size=80, ...}) = 0
lstat("/usr/local/sitipersonali/disco4_ml/NSP/la/av", {st_mode=S_IFDIR|0755, 
st_size=80, ...}) = 0
lstat("/usr/local/sitipersonali/disco4_ml/NSP/la/av/lavoro", 
{st_mode=S_IFDIR|0755, st_size=1024, ...}) = 0
lstat("/usr/local/sitipersonali/disco4_ml/NSP/la/av/lavoro/webspace", 
{st_mode=S_IFDIR|0755, st_size=1024, ...}) = 0
lstat("/usr/local/sitipersonali/disco4_ml/NSP/la/av/lavoro/webspace/httpdocs", 
{st_mode=S_IFDIR|0750, st_size=2048, ...}) = 0
lstat("/usr/local/sitipersonali/disco4_ml/NSP/la/av/lavoro/webspace/httpdocs/wp-includes",
 {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat("/usr/local/sitipersonali/disco4_ml/NSP/la/av/lavoro/webspace/httpdocs/wp-includes/feed-rss2.php",
 {st_mode=S_IFREG|0644, st_size=2513, ...}) = 0
lstat("/usr", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat("/usr/local", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat("/usr/local/sitipersonali", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat("/usr/local/sitipersonali/disco4_ml", {st_mode=S_IFDIR|0755, 
st_size=3072, ...}) = 0
lstat("/usr/local/sitipersonali/disco4_ml/NSP", {st_mode=S_IFDIR|0755, 
st_size=2048, ...}) = 0
lstat("/usr/local/sitipersonali/disco4_ml/NSP/la", {st_mode=S_IFDIR|0755, 
st_size=80, ...}) = 0
lstat("/usr/local/sitipersonali/disco4_ml/NSP/la/av", {st_mode=S_IFDIR|0755, 
st_size=80, ...}) = 0
lstat("/usr/local/sitipersonali/disco4_ml/NSP/la/av/lavoro", 
{st_mode=S_IFDIR|0755, st_size=1024, ...}) = 0
lstat("/usr/local/sitipersonali/disco4_ml/NSP/la/av/lavoro/webspace", 
{st_mode=S_IFDIR|0755, st_size=1024, ...}) = 0
lstat("/usr/local/sitipersonali/disco4_ml/NSP/la/av/lavoro/webspace/httpdocs", 
{st_mode=S_IFDIR|0750, st_size=2048, ...}) = 0
lstat("/usr/local/sitipersonali/disco4_ml/NSP/la/av/lavoro/webspace/httpdocs/wp-includes",
 {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat("/usr/local/sitipersonali/disco4_ml/NSP/la/av/lavoro/webspace/httpdocs/wp-includes/feed-rss2.php",
 {st_mode=S_IFREG|0644, st_size=2513, ...}) = 0
lstat("/usr", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat("/usr/local", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat("/usr/local/sitipersonali", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat("/usr/local/sitipersonali/disco4

RE: [PHP] Apache rule/directive to stop serving PHP pages from /var/www/includes/ [SOLVED]

2010-04-01 Thread Daevid Vincent
> -Original Message-
> From: Robert Cummings [mailto:rob...@interjinn.com] 
> Sent: Thursday, April 01, 2010 7:23 PM
> To: Daevid Vincent
> Cc: php-general@lists.php.net
> Subject: Re: [PHP] Apache rule/directive to stop serving PHP 
> pages from /var/www/includes/
> 
> Daevid Vincent wrote:
> > (Sorry if this is a duplicate. I sent one earlier with 
> "OT:" prefixing the
> > subject line and I think this list software kills the 
> message despite being
> > proper netiquette. *sigh*)
> > 
> > I have your basic web tree setup.
> >  
> > develo...@mypse:/var/www/dart2$ tree -d -I 'CVS'
> > |-- UPDATES
> > |-- ajax
> > |-- images
> > |   |-- gui
> > |   `-- icons
> > `-- includes
> > |-- classes
> > |-- css
> > |-- functions
> > |   `-- xml
> > |-- gui
> > |-- js
> > |   |-- charts
> > `-- pear
> > |-- Auth
> > |-- Benchmark
> > |-- DB
> > |-- Date
> > |-- File
> > |-- Spreadsheet
> > `-- XML_RPC
> >  
> > It's not ideal. I would normally have /includes/ in a 
> directory outside the
> > servable webroot directory, but for various reasons I won't 
> go into, this
> > is how it is.
> > 
> > Now I have Apache configured to NOT allow directory browsing.
> > 
> > I also have a index.html file in most all main directories 
> to log attempts
> > and also redirect back to the main site.
> > 
> > What I don't know how to protect against is if someone were 
> to KNOW the
> > name of a .php file. Say I have /includes/foo.inc.php for 
> example, someone
> > can put that in their URL and apache will happily serve it up. :(
> > 
> > Is there a directive to prevent this?
> > 
> > I would think it should be doable since PHP reads the file 
> directly off of
> > disk via a command like this and isn't really served perse:
> > 
> > require_once ROOTPATH.'/includes/functions/foo.inc.php';
> > 
> > Anyone? Anyone? Beuller? Beuller?
> 
> 
> 
>  Order allow,deny
>  Deny from all
> 
> 

Brilliant! Thanks Rob.

Here is the final that I went with (turns out I had to mind the
/includes/js directory or all my jQuery stuff STB, so that's why I call
each directory out like that):

develo...@myvm:/etc/apache2/sites-enabled$ tail -n20 000-default

# [dv] added 2010-04-01 to prevent serving include files and such

Order allow,deny
Deny from all


Order allow,deny
Deny from all


Order allow,deny
Deny from all


Order allow,deny
Deny from all



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



Re: [PHP] Apache rule/directive to stop serving PHP pages from /var/www/includes/

2010-04-01 Thread Robert Cummings

Daevid Vincent wrote:

(Sorry if this is a duplicate. I sent one earlier with "OT:" prefixing the
subject line and I think this list software kills the message despite being
proper netiquette. *sigh*)

I have your basic web tree setup.
 
develo...@mypse:/var/www/dart2$ tree -d -I 'CVS'

|-- UPDATES
|-- ajax
|-- images
|   |-- gui
|   `-- icons
`-- includes
|-- classes
|-- css
|-- functions
|   `-- xml
|-- gui
|-- js
|   |-- charts
`-- pear
|-- Auth
|-- Benchmark
|-- DB
|-- Date
|-- File
|-- Spreadsheet
`-- XML_RPC
 
It's not ideal. I would normally have /includes/ in a directory outside the

servable webroot directory, but for various reasons I won't go into, this
is how it is.

Now I have Apache configured to NOT allow directory browsing.

I also have a index.html file in most all main directories to log attempts
and also redirect back to the main site.

What I don't know how to protect against is if someone were to KNOW the
name of a .php file. Say I have /includes/foo.inc.php for example, someone
can put that in their URL and apache will happily serve it up. :(

Is there a directive to prevent this?

I would think it should be doable since PHP reads the file directly off of
disk via a command like this and isn't really served perse:

require_once ROOTPATH.'/includes/functions/foo.inc.php';

Anyone? Anyone? Beuller? Beuller?




Order allow,deny
Deny from all



Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP

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



[PHP] Apache rule/directive to stop serving PHP pages from /var/www/includes/

2010-04-01 Thread Daevid Vincent
(Sorry if this is a duplicate. I sent one earlier with "OT:" prefixing the
subject line and I think this list software kills the message despite being
proper netiquette. *sigh*)

I have your basic web tree setup.
 
develo...@mypse:/var/www/dart2$ tree -d -I 'CVS'
|-- UPDATES
|-- ajax
|-- images
|   |-- gui
|   `-- icons
`-- includes
|-- classes
|-- css
|-- functions
|   `-- xml
|-- gui
|-- js
|   |-- charts
`-- pear
|-- Auth
|-- Benchmark
|-- DB
|-- Date
|-- File
|-- Spreadsheet
`-- XML_RPC
 
It's not ideal. I would normally have /includes/ in a directory outside the
servable webroot directory, but for various reasons I won't go into, this
is how it is.

Now I have Apache configured to NOT allow directory browsing.

I also have a index.html file in most all main directories to log attempts
and also redirect back to the main site.

What I don't know how to protect against is if someone were to KNOW the
name of a .php file. Say I have /includes/foo.inc.php for example, someone
can put that in their URL and apache will happily serve it up. :(

Is there a directive to prevent this?

I would think it should be doable since PHP reads the file directly off of
disk via a command like this and isn't really served perse:

require_once ROOTPATH.'/includes/functions/foo.inc.php';

Anyone? Anyone? Beuller? Beuller?


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



Re: [PHP] PHP APACHE SAVE AS

2009-12-02 Thread Julian Muscat Doublesin
Hello Everyone,

I solved the mysql issue too. thanks for your help. I had to change the root
the the extnsion directory as it was set to the linux style. Also found out
that for windows it is always best to use C:/ instead of C:\ This works in
some situations and in others it does not.

On Fri, Nov 27, 2009 at 10:02 PM, Bastien Koert  wrote:

>  On Fri, Nov 27, 2009 at 11:20 AM, Ashley Sheridan
>  wrote:
> > On Fri, 2009-11-27 at 17:10 +0100, Julian Muscat Doublesin wrote:
> >
> >> Hi,
> >>
> >> Just to update every one. This solution below worked perfectly. Thank
> you
> >> very much Jonathan. I have one other question though. Can anyone help me
> on
> >> the folowing. Database Error: Unable to connect to the database:The
> MySQL
> >> adapter "mysql" is not available.
> >>
> >> Thank you
> >>
> >> Julian
> >>
> >> On Fri, Nov 27, 2009 at 1:34 PM, Jonathan Tapicer 
> wrote:
> >>
> >> > You are probably missing something like this in the apache httpd.conf:
> >> >
> >> > LoadModule php5_module "c:/PHP/php5apache2_2.dll"
> >> > PHPIniDir "c:/PHP/php.ini"
> >> > AddType application/x-httpd-php .php
> >> > DirectoryIndex index.php index.html index.html.var
> >> >
> >> > Regards,
> >> >
> >> > Jonathan
> >> >
> >> > On Fri, Nov 27, 2009 at 6:24 AM, Julian Muscat Doublesin
> >> >  wrote:
> >> > > Hello Everyone,
> >> > >
> >> > > I have installed PHP, Apache and MySQL on a Windows 7 machine
> :(.
> >> > I
> >> > > would prefer linux or unix :)
> >> > >
> >> > > These have been setup and working correctly. However when I access a
> php
> >> > > page. I get the save as dialog. Has anyone ever experinced such a
> >> > situation.
> >> > > Can anyone please advise.
> >> > >
> >> > > Thank you very much in advance.
> >> > >
> >> > > Julian
> >> > >
> >> >
> >
> >
> > It sounds like you've installed both PHP and MySQL, but not the
> > php-mysql module, which allows PHP to talk to the database. Depending on
> > how you installed PHP, there could be a variety of ways to fix this.
> >
> > Thanks,
> > Ash
> > http://www.ashleysheridan.co.uk
> >
> >
> >
>
> Try opening the php.ini file and uncommenting the line
>
> ;extension = php_mysql.dll;
>
> (by uncommenting i mean remove the first semi-colon). save the file
> and restart the apache service
>
> --
>
> Bastien
>
> Cat, the other other white meat
>


Re: [PHP] PHP APACHE SAVE AS

2009-11-27 Thread kranthi
as jim stated you'll get a "undefined function" error if php_mysql
extension is not loaded.
in this case probably the MySql server is not running, or not running
on the default port (most likely the former)

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



Re: [PHP] PHP APACHE SAVE AS

2009-11-27 Thread Jim Lucas

Bastien Koert wrote:

On Fri, Nov 27, 2009 at 11:20 AM, Ashley Sheridan
 wrote:

On Fri, 2009-11-27 at 17:10 +0100, Julian Muscat Doublesin wrote:


Hi,

Just to update every one. This solution below worked perfectly. Thank you
very much Jonathan. I have one other question though. Can anyone help me on
the folowing. Database Error: Unable to connect to the database:The MySQL
adapter "mysql" is not available.

Thank you

Julian

On Fri, Nov 27, 2009 at 1:34 PM, Jonathan Tapicer  wrote:


You are probably missing something like this in the apache httpd.conf:

LoadModule php5_module "c:/PHP/php5apache2_2.dll"
PHPIniDir "c:/PHP/php.ini"
AddType application/x-httpd-php .php
DirectoryIndex index.php index.html index.html.var

Regards,

Jonathan

On Fri, Nov 27, 2009 at 6:24 AM, Julian Muscat Doublesin
 wrote:

Hello Everyone,

I have installed PHP, Apache and MySQL on a Windows 7 machine :(.

I

would prefer linux or unix :)

These have been setup and working correctly. However when I access a php
page. I get the save as dialog. Has anyone ever experinced such a

situation.

Can anyone please advise.

Thank you very much in advance.

Julian



It sounds like you've installed both PHP and MySQL, but not the
php-mysql module, which allows PHP to talk to the database. Depending on
how you installed PHP, there could be a variety of ways to fix this.

Thanks,
Ash
http://www.ashleysheridan.co.uk





Try opening the php.ini file and uncommenting the line

;extension = php_mysql.dll;

(by uncommenting i mean remove the first semi-colon). save the file
and restart the apache service



My guess is, that since he said that he is getting an error returned from the function call, that 
the function is being loaded, so the php_mysql.so is being loaded fine.  But the problem, more then 
likely, lies with the arguments being passed to the mysql_connect function call itself.


Check the values that you are passing to your function.  But first, make sure that mysql is actually 
 running.  You should be able to use phpmyadmin, with the correct DB settings, and have it connect 
to the DB.  If that doesn't work, try using a command line utility that came with your mysql 
installation.


Jim Lucas

--
Jim Lucas

   "Some men are born to greatness, some achieve greatness,
   and some have greatness thrust upon them."

Twelfth Night, Act II, Scene V
by William Shakespeare

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



Re: [PHP] PHP APACHE SAVE AS

2009-11-27 Thread Bastien Koert
On Fri, Nov 27, 2009 at 11:20 AM, Ashley Sheridan
 wrote:
> On Fri, 2009-11-27 at 17:10 +0100, Julian Muscat Doublesin wrote:
>
>> Hi,
>>
>> Just to update every one. This solution below worked perfectly. Thank you
>> very much Jonathan. I have one other question though. Can anyone help me on
>> the folowing. Database Error: Unable to connect to the database:The MySQL
>> adapter "mysql" is not available.
>>
>> Thank you
>>
>> Julian
>>
>> On Fri, Nov 27, 2009 at 1:34 PM, Jonathan Tapicer  wrote:
>>
>> > You are probably missing something like this in the apache httpd.conf:
>> >
>> > LoadModule php5_module "c:/PHP/php5apache2_2.dll"
>> > PHPIniDir "c:/PHP/php.ini"
>> > AddType application/x-httpd-php .php
>> > DirectoryIndex index.php index.html index.html.var
>> >
>> > Regards,
>> >
>> > Jonathan
>> >
>> > On Fri, Nov 27, 2009 at 6:24 AM, Julian Muscat Doublesin
>> >  wrote:
>> > > Hello Everyone,
>> > >
>> > > I have installed PHP, Apache and MySQL on a Windows 7 machine :(.
>> > I
>> > > would prefer linux or unix :)
>> > >
>> > > These have been setup and working correctly. However when I access a php
>> > > page. I get the save as dialog. Has anyone ever experinced such a
>> > situation.
>> > > Can anyone please advise.
>> > >
>> > > Thank you very much in advance.
>> > >
>> > > Julian
>> > >
>> >
>
>
> It sounds like you've installed both PHP and MySQL, but not the
> php-mysql module, which allows PHP to talk to the database. Depending on
> how you installed PHP, there could be a variety of ways to fix this.
>
> Thanks,
> Ash
> http://www.ashleysheridan.co.uk
>
>
>

Try opening the php.ini file and uncommenting the line

;extension = php_mysql.dll;

(by uncommenting i mean remove the first semi-colon). save the file
and restart the apache service

-- 

Bastien

Cat, the other other white meat

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



Re: [PHP] PHP APACHE SAVE AS

2009-11-27 Thread Ashley Sheridan
On Fri, 2009-11-27 at 17:10 +0100, Julian Muscat Doublesin wrote:

> Hi,
> 
> Just to update every one. This solution below worked perfectly. Thank you
> very much Jonathan. I have one other question though. Can anyone help me on
> the folowing. Database Error: Unable to connect to the database:The MySQL
> adapter "mysql" is not available.
> 
> Thank you
> 
> Julian
> 
> On Fri, Nov 27, 2009 at 1:34 PM, Jonathan Tapicer  wrote:
> 
> > You are probably missing something like this in the apache httpd.conf:
> >
> > LoadModule php5_module "c:/PHP/php5apache2_2.dll"
> > PHPIniDir "c:/PHP/php.ini"
> > AddType application/x-httpd-php .php
> > DirectoryIndex index.php index.html index.html.var
> >
> > Regards,
> >
> > Jonathan
> >
> > On Fri, Nov 27, 2009 at 6:24 AM, Julian Muscat Doublesin
> >  wrote:
> > > Hello Everyone,
> > >
> > > I have installed PHP, Apache and MySQL on a Windows 7 machine :(.
> > I
> > > would prefer linux or unix :)
> > >
> > > These have been setup and working correctly. However when I access a php
> > > page. I get the save as dialog. Has anyone ever experinced such a
> > situation.
> > > Can anyone please advise.
> > >
> > > Thank you very much in advance.
> > >
> > > Julian
> > >
> >


It sounds like you've installed both PHP and MySQL, but not the
php-mysql module, which allows PHP to talk to the database. Depending on
how you installed PHP, there could be a variety of ways to fix this.

Thanks,
Ash
http://www.ashleysheridan.co.uk




Re: [PHP] PHP APACHE SAVE AS

2009-11-27 Thread Julian Muscat Doublesin
Hi,

Just to update every one. This solution below worked perfectly. Thank you
very much Jonathan. I have one other question though. Can anyone help me on
the folowing. Database Error: Unable to connect to the database:The MySQL
adapter "mysql" is not available.

Thank you

Julian

On Fri, Nov 27, 2009 at 1:34 PM, Jonathan Tapicer  wrote:

> You are probably missing something like this in the apache httpd.conf:
>
> LoadModule php5_module "c:/PHP/php5apache2_2.dll"
> PHPIniDir "c:/PHP/php.ini"
> AddType application/x-httpd-php .php
> DirectoryIndex index.php index.html index.html.var
>
> Regards,
>
> Jonathan
>
> On Fri, Nov 27, 2009 at 6:24 AM, Julian Muscat Doublesin
>  wrote:
> > Hello Everyone,
> >
> > I have installed PHP, Apache and MySQL on a Windows 7 machine :(.
> I
> > would prefer linux or unix :)
> >
> > These have been setup and working correctly. However when I access a php
> > page. I get the save as dialog. Has anyone ever experinced such a
> situation.
> > Can anyone please advise.
> >
> > Thank you very much in advance.
> >
> > Julian
> >
>


Re: [PHP] PHP APACHE SAVE AS

2009-11-27 Thread Jonathan Tapicer
You are probably missing something like this in the apache httpd.conf:

LoadModule php5_module "c:/PHP/php5apache2_2.dll"
PHPIniDir "c:/PHP/php.ini"
AddType application/x-httpd-php .php
DirectoryIndex index.php index.html index.html.var

Regards,

Jonathan

On Fri, Nov 27, 2009 at 6:24 AM, Julian Muscat Doublesin
 wrote:
> Hello Everyone,
>
> I have installed PHP, Apache and MySQL on a Windows 7 machine :(. I
> would prefer linux or unix :)
>
> These have been setup and working correctly. However when I access a php
> page. I get the save as dialog. Has anyone ever experinced such a situation.
> Can anyone please advise.
>
> Thank you very much in advance.
>
> Julian
>

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



Re: [PHP] PHP APACHE SAVE AS

2009-11-27 Thread Lester Caine

Julian Muscat Doublesin wrote:

Hello Everyone,

I have installed PHP, Apache and MySQL on a Windows 7 machine :(. I
would prefer linux or unix :)

These have been setup and working correctly. However when I access a php
page. I get the save as dialog. Has anyone ever experinced such a situation.
Can anyone please advise.

Thank you very much in advance.


Apache obviously does not know how to handle the .php files, so you need to 
update httpd.conf so it can both handle them and load php.


Things get a little tricky depending on WHICH pache and php which you do not 
say, but http://uk3.php.net/manual/en/install.windows.apache2.php should point 
you in the right direction ...


--
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php

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



Re: [PHP] PHP APACHE SAVE AS

2009-11-27 Thread Tanveer Chowdhury
That means its not recognizing the php code and thats why its giving the
download prompt. why not install xampp or wamp.

On Fri, Nov 27, 2009 at 4:24 AM, Julian Muscat Doublesin <
opensourc...@gmail.com> wrote:

> Hello Everyone,
>
> I have installed PHP, Apache and MySQL on a Windows 7 machine :(. I
> would prefer linux or unix :)
>
> These have been setup and working correctly. However when I access a php
> page. I get the save as dialog. Has anyone ever experinced such a
> situation.
> Can anyone please advise.
>
> Thank you very much in advance.
>
> Julian
>



-- 
- Ŧ₳ᶇṾḛḗƦ


[PHP] PHP APACHE SAVE AS

2009-11-27 Thread Julian Muscat Doublesin
Hello Everyone,

I have installed PHP, Apache and MySQL on a Windows 7 machine :(. I
would prefer linux or unix :)

These have been setup and working correctly. However when I access a php
page. I get the save as dialog. Has anyone ever experinced such a situation.
Can anyone please advise.

Thank you very much in advance.

Julian


[PHP] Apache file order

2009-10-28 Thread Skip Evans

Hey all,

I modified an Apache config file to list the HTML file first, 
after the PHP file, it still pulls up the PHP file first.


Is there another setting in Apache I should be looking for?

I need it to check for the HTML file first.

Thanks,
Skip


DirectoryIndex index.html index.php



--

Skip Evans
PenguinSites.com, LLC
503 S Baldwin St, #1
Madison WI 53703
608.250.2720
http://penguinsites.com

Those of you who believe in
telekinesis, raise my hand.
 -- Kurt Vonnegut

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



Re: [PHP] PHP+Apache suddenly not working

2009-10-27 Thread Jason Lixfeld
 in and of itself considering pcre is a installed properly  
too :|


[r...@ricky /usr/local/www]# cat /usr/local/etc/php.ini | egrep -i  
'error|log' | grep -v "^;"

error_reporting  =  E_ALL
display_errors = On
display_startup_errors = On
log_errors = On
log_errors_max_len = 1024
ignore_repeated_errors = Off
track_errors = Off
html_errors = On
error_log = /tmp/php.log
[Syslog]
define_syslog_variables  = Off
pgsql.log_notice = 0
sybase.min_error_severity = 10
mssql.min_error_severity = 10
[r...@ricky /usr/local/www]#


On 2009-10-27, at 12:39 PM, Yuri Yarlei wrote:



Ash,

I think the apache is working, because he recieve the error "[27- 
Oct-2009 13:05:00] PHP Fatal error:  Call to undefined function", if  
apache are not started he will receive some error about apache  
starting or someting like that.


Yuri Yarlei.
http://www.yuriyarlei.net.net (under construction)
Programmer PHP, JAVA, CSS, PostregreSQL;
Today PHP, tomorrow Java, after the world.
Kyou wa PHP, ashita wa Java, sono ato sekai desu.





From: a...@ashleysheridan.co.uk
To: gargari...@hotmail.com
CC: li...@cmsws.com; phps...@gmail.com; jason-lists@lixfeld.ca; 
php-general@lists.php.net
Date: Tue, 27 Oct 2009 16:20:45 +
Subject: RE: [PHP] PHP+Apache suddenly not working

On Tue, 2009-10-27 at 19:16 +0300, Yuri Yarlei wrote:


Hi all,



If the basic functions of php not work, maybe the extension for  
php5 or 4 are disabled, or the library is missing, sometimes  
apache does not show the erros for missing library, or yet, the  
library for php4 or 5 are both on, or they crash


Yuri Yarlei.
www.yuriyarlei.net (under construction)
Programmer PHP, JAVA, CSS, PostregreSQL;
Today PHP, tomorrow Java, after the world.
Kyou wa PHP, ashita wa Java, sono ato sekai desu.





Date: Tue, 27 Oct 2009 07:59:16 -0700
From: li...@cmsws.com
To: a...@ashleysheridan.co.uk
CC: phps...@gmail.com; jason-lists@lixfeld.ca; php-general@lists.php.net
Subject: Re: [PHP] PHP+Apache suddenly not working

Ashley Sheridan wrote:

On Tue, 2009-10-27 at 09:24 -0400, Bastien Koert wrote:


On Tue, Oct 27, 2009 at 9:18 AM, Jason Lixfeld
 wrote:
I have no doubt that this is due to an update that was done on  
my system at
some point, but unfortunately I can't pinpoint where. The  
upshot is that
PHP is completely unresponsive for me when run from Apache and  
I'm not sure
where to look. I recognize that this isn't an apache support  
list. This

message is being cc'd there too.

The system is FreeBSD 6.1-RELEASE-p15. PHP 5.2.11 from ports.

The only error I get in my php log is this:

[27-Oct-2009 13:05:00] PHP Fatal error: Call to undefined  
function

preg_match() in
/usr/home/foo/public_html/cerb4/libs/devblocks/libs/ 
zend_framework/Zend/Cache/Backend/File.php

on line 125

Now I've checked and double checked that pcre support is built  
into php.
I'm not sure if there's a command that I can run in php to  
show all the
extensions that are installed or something, but I'm a  
bazillion percent sure
that it's there, so I don't believe that's the cause of the  
error. I'm
reasonably sure of this because the preg_match error thrown  
every minute
when a cron job runs, I have a .php that calls phpinfo() that  
shows a blank

screen when hit from a browser.

My problem is that I don't know how to troubleshoot this.

I can seem to run PHP from the CLI just fine, so does this  
look more like an
apache issue or perhaps some php module or extension that  
talks to apache?


[r...@ricky /]# php

phpinfo()
PHP Version => 5.2.11

System => FreeBSD ricky.arionetworks.ca 6.1-RELEASE-p15 FreeBSD
6.1-RELEASE-p15 #0: Sat Mar 31 11:43:34 EDT 2007
jlixf...@ricky.arionetworks.ca:/usr/src/sys/amd64/compile/ 
GENERIC amd64

Build Date => Oct 26 2009 15:38:06
Configure Command => './configure' '--with-layout=GNU'
'--with-config-file-scan-dir=/usr/local/etc/php' '--disable-all'
'--enable-libxml' '--with-libxml-dir=/usr/local' '--enable- 
reflection'
'--program-prefix=' '--enable-fastcgi' '--with-apxs2=/usr/ 
local/sbin/apxs'

'--with-regex=php' '--with-zend-vm=CALL' '--disable-ipv6'
'--prefix=/usr/local' '--mandir=/usr/local/man' '--infodir=/ 
usr/local/info/'

'--build=amd64-portbld-freebsd6.1'
Server API => Command Line Interface
Virtual Directory Support => disabled
Configuration File (php.ini) Path => /usr/local/etc
Loaded Configuration File => /usr/local/etc/php.ini
Scan this dir for additional .ini files => /usr/local/etc/php
additional .ini files parsed => /usr/local/etc/php/ 
extensions.ini

...
...
...
etc
...

[r...@ricky /]# pkg_info | grep php5
php5-5.2.11_1 PHP Scripting Language
php5-ctype-5.2.11_1 The ctype shared extension for php
php5-dom-5.2.11_1 The dom shared extension for php

RE: [PHP] PHP+Apache suddenly not working

2009-10-27 Thread Yuri Yarlei

Ash,

I think the apache is working, because he recieve the error "[27-Oct-2009 
13:05:00] PHP Fatal error:  Call to undefined function", if apache are not 
started he will receive some error about apache starting or someting like that.

Yuri Yarlei.
http://www.yuriyarlei.net.net (under construction)
Programmer PHP, JAVA, CSS, PostregreSQL;
Today PHP, tomorrow Java, after the world.
Kyou wa PHP, ashita wa Java, sono ato sekai desu.



 
> From: a...@ashleysheridan.co.uk
> To: gargari...@hotmail.com
> CC: li...@cmsws.com; phps...@gmail.com; jason-lists@lixfeld.ca; 
> php-general@lists.php.net
> Date: Tue, 27 Oct 2009 16:20:45 +0000
> Subject: RE: [PHP] PHP+Apache suddenly not working
> 
> On Tue, 2009-10-27 at 19:16 +0300, Yuri Yarlei wrote:
> 
> > Hi all,
> > 
> > 
> > 
> > If the basic functions of php not work, maybe the extension for php5 or 4 
> > are disabled, or the library is missing, sometimes apache does not show the 
> > erros for missing library, or yet, the library for php4 or 5 are both on, 
> > or they crash
> > 
> > Yuri Yarlei.
> > www.yuriyarlei.net (under construction)
> > Programmer PHP, JAVA, CSS, PostregreSQL;
> > Today PHP, tomorrow Java, after the world.
> > Kyou wa PHP, ashita wa Java, sono ato sekai desu.
> > 
> > 
> > 
> > 
> > > Date: Tue, 27 Oct 2009 07:59:16 -0700
> > > From: li...@cmsws.com
> > > To: a...@ashleysheridan.co.uk
> > > CC: phps...@gmail.com; jason-lists@lixfeld.ca; 
> > > php-general@lists.php.net
> > > Subject: Re: [PHP] PHP+Apache suddenly not working
> > > 
> > > Ashley Sheridan wrote:
> > > > On Tue, 2009-10-27 at 09:24 -0400, Bastien Koert wrote:
> > > > 
> > > >> On Tue, Oct 27, 2009 at 9:18 AM, Jason Lixfeld
> > > >>  wrote:
> > > >>> I have no doubt that this is due to an update that was done on my 
> > > >>> system at
> > > >>> some point, but unfortunately I can't pinpoint where. The upshot is 
> > > >>> that
> > > >>> PHP is completely unresponsive for me when run from Apache and I'm 
> > > >>> not sure
> > > >>> where to look. I recognize that this isn't an apache support list. 
> > > >>> This
> > > >>> message is being cc'd there too.
> > > >>>
> > > >>> The system is FreeBSD 6.1-RELEASE-p15. PHP 5.2.11 from ports.
> > > >>>
> > > >>> The only error I get in my php log is this:
> > > >>>
> > > >>> [27-Oct-2009 13:05:00] PHP Fatal error: Call to undefined function
> > > >>> preg_match() in
> > > >>> /usr/home/foo/public_html/cerb4/libs/devblocks/libs/zend_framework/Zend/Cache/Backend/File.php
> > > >>> on line 125
> > > >>>
> > > >>> Now I've checked and double checked that pcre support is built into 
> > > >>> php.
> > > >>> I'm not sure if there's a command that I can run in php to show all 
> > > >>> the
> > > >>> extensions that are installed or something, but I'm a bazillion 
> > > >>> percent sure
> > > >>> that it's there, so I don't believe that's the cause of the error. I'm
> > > >>> reasonably sure of this because the preg_match error thrown every 
> > > >>> minute
> > > >>> when a cron job runs, I have a .php that calls phpinfo() that shows a 
> > > >>> blank
> > > >>> screen when hit from a browser.
> > > >>>
> > > >>> My problem is that I don't know how to troubleshoot this.
> > > >>>
> > > >>> I can seem to run PHP from the CLI just fine, so does this look more 
> > > >>> like an
> > > >>> apache issue or perhaps some php module or extension that talks to 
> > > >>> apache?
> > > >>>
> > > >>> [r...@ricky /]# php
> > > >>>  > > >>> phpinfo();
> > > >>> ?>
> > > >>> phpinfo()
> > > >>> PHP Version => 5.2.11
> > > >>>
> > > >>> System => FreeBSD ricky.arionetworks.ca 6.1-RELEASE-p15 FreeBSD
> > > >>> 6.1-RELEASE-p15 #0: Sat Mar 31 11:43:34 EDT 2007
> > > >>> jlixf...@ricky.arionetworks.ca:/usr/src/sys/amd64/compile/GENERIC 
> &

RE: [PHP] PHP+Apache suddenly not working

2009-10-27 Thread Ashley Sheridan
On Tue, 2009-10-27 at 19:16 +0300, Yuri Yarlei wrote:

> Hi all,
> 
>  
> 
> If the basic functions of php not work, maybe the extension for php5 or 4 are 
> disabled, or the library is missing, sometimes apache does not show the erros 
> for missing library, or yet, the library for php4 or 5 are both on, or they 
> crash
> 
> Yuri Yarlei.
> www.yuriyarlei.net (under construction)
> Programmer PHP, JAVA, CSS, PostregreSQL;
> Today PHP, tomorrow Java, after the world.
> Kyou wa PHP, ashita wa Java, sono ato sekai desu.
> 
> 
> 
>  
> > Date: Tue, 27 Oct 2009 07:59:16 -0700
> > From: li...@cmsws.com
> > To: a...@ashleysheridan.co.uk
> > CC: phps...@gmail.com; jason-lists@lixfeld.ca; php-general@lists.php.net
> > Subject: Re: [PHP] PHP+Apache suddenly not working
> > 
> > Ashley Sheridan wrote:
> > > On Tue, 2009-10-27 at 09:24 -0400, Bastien Koert wrote:
> > > 
> > >> On Tue, Oct 27, 2009 at 9:18 AM, Jason Lixfeld
> > >>  wrote:
> > >>> I have no doubt that this is due to an update that was done on my 
> > >>> system at
> > >>> some point, but unfortunately I can't pinpoint where. The upshot is that
> > >>> PHP is completely unresponsive for me when run from Apache and I'm not 
> > >>> sure
> > >>> where to look. I recognize that this isn't an apache support list. This
> > >>> message is being cc'd there too.
> > >>>
> > >>> The system is FreeBSD 6.1-RELEASE-p15. PHP 5.2.11 from ports.
> > >>>
> > >>> The only error I get in my php log is this:
> > >>>
> > >>> [27-Oct-2009 13:05:00] PHP Fatal error: Call to undefined function
> > >>> preg_match() in
> > >>> /usr/home/foo/public_html/cerb4/libs/devblocks/libs/zend_framework/Zend/Cache/Backend/File.php
> > >>> on line 125
> > >>>
> > >>> Now I've checked and double checked that pcre support is built into php.
> > >>> I'm not sure if there's a command that I can run in php to show all the
> > >>> extensions that are installed or something, but I'm a bazillion percent 
> > >>> sure
> > >>> that it's there, so I don't believe that's the cause of the error. I'm
> > >>> reasonably sure of this because the preg_match error thrown every minute
> > >>> when a cron job runs, I have a .php that calls phpinfo() that shows a 
> > >>> blank
> > >>> screen when hit from a browser.
> > >>>
> > >>> My problem is that I don't know how to troubleshoot this.
> > >>>
> > >>> I can seem to run PHP from the CLI just fine, so does this look more 
> > >>> like an
> > >>> apache issue or perhaps some php module or extension that talks to 
> > >>> apache?
> > >>>
> > >>> [r...@ricky /]# php
> > >>>  > >>> phpinfo();
> > >>> ?>
> > >>> phpinfo()
> > >>> PHP Version => 5.2.11
> > >>>
> > >>> System => FreeBSD ricky.arionetworks.ca 6.1-RELEASE-p15 FreeBSD
> > >>> 6.1-RELEASE-p15 #0: Sat Mar 31 11:43:34 EDT 2007
> > >>> jlixf...@ricky.arionetworks.ca:/usr/src/sys/amd64/compile/GENERIC amd64
> > >>> Build Date => Oct 26 2009 15:38:06
> > >>> Configure Command => './configure' '--with-layout=GNU'
> > >>> '--with-config-file-scan-dir=/usr/local/etc/php' '--disable-all'
> > >>> '--enable-libxml' '--with-libxml-dir=/usr/local' '--enable-reflection'
> > >>> '--program-prefix=' '--enable-fastcgi' 
> > >>> '--with-apxs2=/usr/local/sbin/apxs'
> > >>> '--with-regex=php' '--with-zend-vm=CALL' '--disable-ipv6'
> > >>> '--prefix=/usr/local' '--mandir=/usr/local/man' 
> > >>> '--infodir=/usr/local/info/'
> > >>> '--build=amd64-portbld-freebsd6.1'
> > >>> Server API => Command Line Interface
> > >>> Virtual Directory Support => disabled
> > >>> Configuration File (php.ini) Path => /usr/local/etc
> > >>> Loaded Configuration File => /usr/local/etc/php.ini
> > >>> Scan this dir for additional .ini files => /usr/local/etc/php
> > >

RE: [PHP] PHP+Apache suddenly not working

2009-10-27 Thread Yuri Yarlei

Hi all,

 

If the basic functions of php not work, maybe the extension for php5 or 4 are 
disabled, or the library is missing, sometimes apache does not show the erros 
for missing library, or yet, the library for php4 or 5 are both on, or they 
crash

Yuri Yarlei.
www.yuriyarlei.net (under construction)
Programmer PHP, JAVA, CSS, PostregreSQL;
Today PHP, tomorrow Java, after the world.
Kyou wa PHP, ashita wa Java, sono ato sekai desu.



 
> Date: Tue, 27 Oct 2009 07:59:16 -0700
> From: li...@cmsws.com
> To: a...@ashleysheridan.co.uk
> CC: phps...@gmail.com; jason-lists@lixfeld.ca; php-general@lists.php.net
> Subject: Re: [PHP] PHP+Apache suddenly not working
> 
> Ashley Sheridan wrote:
> > On Tue, 2009-10-27 at 09:24 -0400, Bastien Koert wrote:
> > 
> >> On Tue, Oct 27, 2009 at 9:18 AM, Jason Lixfeld
> >>  wrote:
> >>> I have no doubt that this is due to an update that was done on my system 
> >>> at
> >>> some point, but unfortunately I can't pinpoint where. The upshot is that
> >>> PHP is completely unresponsive for me when run from Apache and I'm not 
> >>> sure
> >>> where to look. I recognize that this isn't an apache support list. This
> >>> message is being cc'd there too.
> >>>
> >>> The system is FreeBSD 6.1-RELEASE-p15. PHP 5.2.11 from ports.
> >>>
> >>> The only error I get in my php log is this:
> >>>
> >>> [27-Oct-2009 13:05:00] PHP Fatal error: Call to undefined function
> >>> preg_match() in
> >>> /usr/home/foo/public_html/cerb4/libs/devblocks/libs/zend_framework/Zend/Cache/Backend/File.php
> >>> on line 125
> >>>
> >>> Now I've checked and double checked that pcre support is built into php.
> >>> I'm not sure if there's a command that I can run in php to show all the
> >>> extensions that are installed or something, but I'm a bazillion percent 
> >>> sure
> >>> that it's there, so I don't believe that's the cause of the error. I'm
> >>> reasonably sure of this because the preg_match error thrown every minute
> >>> when a cron job runs, I have a .php that calls phpinfo() that shows a 
> >>> blank
> >>> screen when hit from a browser.
> >>>
> >>> My problem is that I don't know how to troubleshoot this.
> >>>
> >>> I can seem to run PHP from the CLI just fine, so does this look more like 
> >>> an
> >>> apache issue or perhaps some php module or extension that talks to apache?
> >>>
> >>> [r...@ricky /]# php
> >>>  >>> phpinfo();
> >>> ?>
> >>> phpinfo()
> >>> PHP Version => 5.2.11
> >>>
> >>> System => FreeBSD ricky.arionetworks.ca 6.1-RELEASE-p15 FreeBSD
> >>> 6.1-RELEASE-p15 #0: Sat Mar 31 11:43:34 EDT 2007
> >>> jlixf...@ricky.arionetworks.ca:/usr/src/sys/amd64/compile/GENERIC amd64
> >>> Build Date => Oct 26 2009 15:38:06
> >>> Configure Command => './configure' '--with-layout=GNU'
> >>> '--with-config-file-scan-dir=/usr/local/etc/php' '--disable-all'
> >>> '--enable-libxml' '--with-libxml-dir=/usr/local' '--enable-reflection'
> >>> '--program-prefix=' '--enable-fastcgi' '--with-apxs2=/usr/local/sbin/apxs'
> >>> '--with-regex=php' '--with-zend-vm=CALL' '--disable-ipv6'
> >>> '--prefix=/usr/local' '--mandir=/usr/local/man' 
> >>> '--infodir=/usr/local/info/'
> >>> '--build=amd64-portbld-freebsd6.1'
> >>> Server API => Command Line Interface
> >>> Virtual Directory Support => disabled
> >>> Configuration File (php.ini) Path => /usr/local/etc
> >>> Loaded Configuration File => /usr/local/etc/php.ini
> >>> Scan this dir for additional .ini files => /usr/local/etc/php
> >>> additional .ini files parsed => /usr/local/etc/php/extensions.ini
> >>> ...
> >>> ...
> >>> ...
> >>> etc
> >>> ...
> >>>
> >>> [r...@ricky /]# pkg_info | grep php5
> >>> php5-5.2.11_1 PHP Scripting Language
> >>> php5-ctype-5.2.11_1 The ctype shared extension for php
> >>> php5-dom-5.2.11_1 The dom shared extension for php
> >>> php5-extensions-1.3 A "meta-port" to install P

RE: [PHP] PHP+Apache suddenly not working

2009-10-27 Thread Yuri Yarlei

Hi all,

 

If the basic functions of php not work, maybe the extension for php5 or 4 are 
disabled, or the library is missing, sometimes apache does not show the erros 
for missing library, or yet, the library for php4 or 5 are both on, or they 
crash

Yuri Yarlei.
www.yuriyarlei.net (under construction)
Programmer PHP, JAVA, CSS, PostregreSQL;
Today PHP, tomorrow Java, after the world.
Kyou wa PHP, ashita wa Java, sono ato sekai desu.



 
> Date: Tue, 27 Oct 2009 07:59:16 -0700
> From: li...@cmsws.com
> To: a...@ashleysheridan.co.uk
> CC: phps...@gmail.com; jason-lists@lixfeld.ca; php-general@lists.php.net
> Subject: Re: [PHP] PHP+Apache suddenly not working
> 
> Ashley Sheridan wrote:
> > On Tue, 2009-10-27 at 09:24 -0400, Bastien Koert wrote:
> > 
> >> On Tue, Oct 27, 2009 at 9:18 AM, Jason Lixfeld
> >>  wrote:
> >>> I have no doubt that this is due to an update that was done on my system 
> >>> at
> >>> some point, but unfortunately I can't pinpoint where. The upshot is that
> >>> PHP is completely unresponsive for me when run from Apache and I'm not 
> >>> sure
> >>> where to look. I recognize that this isn't an apache support list. This
> >>> message is being cc'd there too.
> >>>
> >>> The system is FreeBSD 6.1-RELEASE-p15. PHP 5.2.11 from ports.
> >>>
> >>> The only error I get in my php log is this:
> >>>
> >>> [27-Oct-2009 13:05:00] PHP Fatal error: Call to undefined function
> >>> preg_match() in
> >>> /usr/home/foo/public_html/cerb4/libs/devblocks/libs/zend_framework/Zend/Cache/Backend/File.php
> >>> on line 125
> >>>
> >>> Now I've checked and double checked that pcre support is built into php.
> >>> I'm not sure if there's a command that I can run in php to show all the
> >>> extensions that are installed or something, but I'm a bazillion percent 
> >>> sure
> >>> that it's there, so I don't believe that's the cause of the error. I'm
> >>> reasonably sure of this because the preg_match error thrown every minute
> >>> when a cron job runs, I have a .php that calls phpinfo() that shows a 
> >>> blank
> >>> screen when hit from a browser.
> >>>
> >>> My problem is that I don't know how to troubleshoot this.
> >>>
> >>> I can seem to run PHP from the CLI just fine, so does this look more like 
> >>> an
> >>> apache issue or perhaps some php module or extension that talks to apache?
> >>>
> >>> [r...@ricky /]# php
> >>>  >>> phpinfo();
> >>> ?>
> >>> phpinfo()
> >>> PHP Version => 5.2.11
> >>>
> >>> System => FreeBSD ricky.arionetworks.ca 6.1-RELEASE-p15 FreeBSD
> >>> 6.1-RELEASE-p15 #0: Sat Mar 31 11:43:34 EDT 2007
> >>> jlixf...@ricky.arionetworks.ca:/usr/src/sys/amd64/compile/GENERIC amd64
> >>> Build Date => Oct 26 2009 15:38:06
> >>> Configure Command => './configure' '--with-layout=GNU'
> >>> '--with-config-file-scan-dir=/usr/local/etc/php' '--disable-all'
> >>> '--enable-libxml' '--with-libxml-dir=/usr/local' '--enable-reflection'
> >>> '--program-prefix=' '--enable-fastcgi' '--with-apxs2=/usr/local/sbin/apxs'
> >>> '--with-regex=php' '--with-zend-vm=CALL' '--disable-ipv6'
> >>> '--prefix=/usr/local' '--mandir=/usr/local/man' 
> >>> '--infodir=/usr/local/info/'
> >>> '--build=amd64-portbld-freebsd6.1'
> >>> Server API => Command Line Interface
> >>> Virtual Directory Support => disabled
> >>> Configuration File (php.ini) Path => /usr/local/etc
> >>> Loaded Configuration File => /usr/local/etc/php.ini
> >>> Scan this dir for additional .ini files => /usr/local/etc/php
> >>> additional .ini files parsed => /usr/local/etc/php/extensions.ini
> >>> ...
> >>> ...
> >>> ...
> >>> etc
> >>> ...
> >>>
> >>> [r...@ricky /]# pkg_info | grep php5
> >>> php5-5.2.11_1 PHP Scripting Language
> >>> php5-ctype-5.2.11_1 The ctype shared extension for php
> >>> php5-dom-5.2.11_1 The dom shared extension for php
> >>> php5-extensions-1.3 A "meta-port" to install P

Re: [PHP] PHP+Apache suddenly not working

2009-10-27 Thread Jim Lucas
Ashley Sheridan wrote:
> On Tue, 2009-10-27 at 09:24 -0400, Bastien Koert wrote:
> 
>> On Tue, Oct 27, 2009 at 9:18 AM, Jason Lixfeld
>>  wrote:
>>> I have no doubt that this is due to an update that was done on my system at
>>> some point, but unfortunately I can't pinpoint where.  The upshot is that
>>> PHP is completely unresponsive for me when run from Apache and I'm not sure
>>> where to look.  I recognize that this isn't an apache support list.  This
>>> message is being cc'd there too.
>>>
>>> The system is FreeBSD 6.1-RELEASE-p15.  PHP 5.2.11 from ports.
>>>
>>> The only error I get in my php log is this:
>>>
>>> [27-Oct-2009 13:05:00] PHP Fatal error:  Call to undefined function
>>> preg_match() in
>>> /usr/home/foo/public_html/cerb4/libs/devblocks/libs/zend_framework/Zend/Cache/Backend/File.php
>>> on line 125
>>>
>>> Now I've checked and double checked that pcre support is built into php.
>>>  I'm not sure if there's a command that I can run in php to show all the
>>> extensions that are installed or something, but I'm a bazillion percent sure
>>> that it's there, so I don't believe that's the cause of the error.  I'm
>>> reasonably sure of this because the preg_match error thrown every minute
>>> when a cron job runs, I have a .php that calls phpinfo() that shows a blank
>>> screen when hit from a browser.
>>>
>>> My problem is that I don't know how to troubleshoot this.
>>>
>>> I can seem to run PHP from the CLI just fine, so does this look more like an
>>> apache issue or perhaps some php module or extension that talks to apache?
>>>
>>> [r...@ricky /]# php
>>> >> phpinfo();
>>> ?>
>>> phpinfo()
>>> PHP Version => 5.2.11
>>>
>>> System => FreeBSD ricky.arionetworks.ca 6.1-RELEASE-p15 FreeBSD
>>> 6.1-RELEASE-p15 #0: Sat Mar 31 11:43:34 EDT 2007
>>> jlixf...@ricky.arionetworks.ca:/usr/src/sys/amd64/compile/GENERIC amd64
>>> Build Date => Oct 26 2009 15:38:06
>>> Configure Command =>  './configure'  '--with-layout=GNU'
>>> '--with-config-file-scan-dir=/usr/local/etc/php' '--disable-all'
>>> '--enable-libxml' '--with-libxml-dir=/usr/local' '--enable-reflection'
>>> '--program-prefix=' '--enable-fastcgi' '--with-apxs2=/usr/local/sbin/apxs'
>>> '--with-regex=php' '--with-zend-vm=CALL' '--disable-ipv6'
>>> '--prefix=/usr/local' '--mandir=/usr/local/man' '--infodir=/usr/local/info/'
>>> '--build=amd64-portbld-freebsd6.1'
>>> Server API => Command Line Interface
>>> Virtual Directory Support => disabled
>>> Configuration File (php.ini) Path => /usr/local/etc
>>> Loaded Configuration File => /usr/local/etc/php.ini
>>> Scan this dir for additional .ini files => /usr/local/etc/php
>>> additional .ini files parsed => /usr/local/etc/php/extensions.ini
>>> ...
>>> ...
>>> ...
>>> etc
>>> ...
>>>
>>> [r...@ricky /]# pkg_info | grep php5
>>> php5-5.2.11_1   PHP Scripting Language
>>> php5-ctype-5.2.11_1 The ctype shared extension for php
>>> php5-dom-5.2.11_1   The dom shared extension for php
>>> php5-extensions-1.3 A "meta-port" to install PHP extensions
>>> php5-filter-5.2.11_1 The filter shared extension for php
>>> php5-gd-5.2.11_1The gd shared extension for php
>>> php5-gettext-5.2.11_1 The gettext shared extension for php
>>> php5-iconv-5.2.11_1 The iconv shared extension for php
>>> php5-imap-5.2.11_1  The imap shared extension for php
>>> php5-ldap-5.2.11_1  The ldap shared extension for php
>>> php5-mbstring-5.2.11_1 The mbstring shared extension for php
>>> php5-mysql-5.2.11_1 The mysql shared extension for php
>>> php5-openssl-5.2.11_1 The openssl shared extension for php
>>> php5-pcre-5.2.11_1  The pcre shared extension for php
>>> php5-pdo-5.2.11_1   The pdo shared extension for php
>>> php5-pdo_sqlite-5.2.11_1 The pdo_sqlite shared extension for php
>>> php5-posix-5.2.11_1 The posix shared extension for php
>>> php5-session-5.2.11_1 The session shared extension for php
>>> php5-simplexml-5.2.11_1 The simplexml shared extension for php
>>> php5-spl-5.2.11_1   The spl shared extension for php
>>> php5-sqlite-5.2.11_1 The sqlite shared extension for php
>>> php5-tokenizer-5.2.11_1 The tokenizer shared extension for php
>>> php5-xml-5.2.11_1   The xml shared extension for php
>>> php5-xmlreader-5.2.11_1 The xmlreader shared extension for php
>>> php5-xmlwriter-5.2.11_1 The xmlwriter shared extension for php
>>> [r...@ricky /]#
>>>
>>> Any ideas for a completely ignorant, non-developer type?
>>>
>>> Thanks in advance.
>>>
>>> --
>>> PHP General Mailing List (http://www.php.net/)
>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>
>>>
>> create a small file with this code
>>
>> 
>>
>> which will tell you want modules are enabled in php
>>
>> -- 
>>
>> Bastien
>>
>> Cat, the other other white meat
>>
> 
> He already mentioned that phpinfo() fails.
> 
> Thanks,
> Ash
> http://www.ashleysheridan.co.uk
> 
> 
> 

No, he mentioned that the "page" that he navigates to fails.

My best guess would be that he is getting a fatal error, like he mentioned
above, which is preventing the output of t

Re: [PHP] PHP+Apache suddenly not working

2009-10-27 Thread Ashley Sheridan
On Tue, 2009-10-27 at 09:24 -0400, Bastien Koert wrote:

> On Tue, Oct 27, 2009 at 9:18 AM, Jason Lixfeld
>  wrote:
> > I have no doubt that this is due to an update that was done on my system at
> > some point, but unfortunately I can't pinpoint where.  The upshot is that
> > PHP is completely unresponsive for me when run from Apache and I'm not sure
> > where to look.  I recognize that this isn't an apache support list.  This
> > message is being cc'd there too.
> >
> > The system is FreeBSD 6.1-RELEASE-p15.  PHP 5.2.11 from ports.
> >
> > The only error I get in my php log is this:
> >
> > [27-Oct-2009 13:05:00] PHP Fatal error:  Call to undefined function
> > preg_match() in
> > /usr/home/foo/public_html/cerb4/libs/devblocks/libs/zend_framework/Zend/Cache/Backend/File.php
> > on line 125
> >
> > Now I've checked and double checked that pcre support is built into php.
> >  I'm not sure if there's a command that I can run in php to show all the
> > extensions that are installed or something, but I'm a bazillion percent sure
> > that it's there, so I don't believe that's the cause of the error.  I'm
> > reasonably sure of this because the preg_match error thrown every minute
> > when a cron job runs, I have a .php that calls phpinfo() that shows a blank
> > screen when hit from a browser.
> >
> > My problem is that I don't know how to troubleshoot this.
> >
> > I can seem to run PHP from the CLI just fine, so does this look more like an
> > apache issue or perhaps some php module or extension that talks to apache?
> >
> > [r...@ricky /]# php
> >  > phpinfo();
> > ?>
> > phpinfo()
> > PHP Version => 5.2.11
> >
> > System => FreeBSD ricky.arionetworks.ca 6.1-RELEASE-p15 FreeBSD
> > 6.1-RELEASE-p15 #0: Sat Mar 31 11:43:34 EDT 2007
> > jlixf...@ricky.arionetworks.ca:/usr/src/sys/amd64/compile/GENERIC amd64
> > Build Date => Oct 26 2009 15:38:06
> > Configure Command =>  './configure'  '--with-layout=GNU'
> > '--with-config-file-scan-dir=/usr/local/etc/php' '--disable-all'
> > '--enable-libxml' '--with-libxml-dir=/usr/local' '--enable-reflection'
> > '--program-prefix=' '--enable-fastcgi' '--with-apxs2=/usr/local/sbin/apxs'
> > '--with-regex=php' '--with-zend-vm=CALL' '--disable-ipv6'
> > '--prefix=/usr/local' '--mandir=/usr/local/man' '--infodir=/usr/local/info/'
> > '--build=amd64-portbld-freebsd6.1'
> > Server API => Command Line Interface
> > Virtual Directory Support => disabled
> > Configuration File (php.ini) Path => /usr/local/etc
> > Loaded Configuration File => /usr/local/etc/php.ini
> > Scan this dir for additional .ini files => /usr/local/etc/php
> > additional .ini files parsed => /usr/local/etc/php/extensions.ini
> > ...
> > ...
> > ...
> > etc
> > ...
> >
> > [r...@ricky /]# pkg_info | grep php5
> > php5-5.2.11_1   PHP Scripting Language
> > php5-ctype-5.2.11_1 The ctype shared extension for php
> > php5-dom-5.2.11_1   The dom shared extension for php
> > php5-extensions-1.3 A "meta-port" to install PHP extensions
> > php5-filter-5.2.11_1 The filter shared extension for php
> > php5-gd-5.2.11_1The gd shared extension for php
> > php5-gettext-5.2.11_1 The gettext shared extension for php
> > php5-iconv-5.2.11_1 The iconv shared extension for php
> > php5-imap-5.2.11_1  The imap shared extension for php
> > php5-ldap-5.2.11_1  The ldap shared extension for php
> > php5-mbstring-5.2.11_1 The mbstring shared extension for php
> > php5-mysql-5.2.11_1 The mysql shared extension for php
> > php5-openssl-5.2.11_1 The openssl shared extension for php
> > php5-pcre-5.2.11_1  The pcre shared extension for php
> > php5-pdo-5.2.11_1   The pdo shared extension for php
> > php5-pdo_sqlite-5.2.11_1 The pdo_sqlite shared extension for php
> > php5-posix-5.2.11_1 The posix shared extension for php
> > php5-session-5.2.11_1 The session shared extension for php
> > php5-simplexml-5.2.11_1 The simplexml shared extension for php
> > php5-spl-5.2.11_1   The spl shared extension for php
> > php5-sqlite-5.2.11_1 The sqlite shared extension for php
> > php5-tokenizer-5.2.11_1 The tokenizer shared extension for php
> > php5-xml-5.2.11_1   The xml shared extension for php
> > php5-xmlreader-5.2.11_1 The xmlreader shared extension for php
> > php5-xmlwriter-5.2.11_1 The xmlwriter shared extension for php
> > [r...@ricky /]#
> >
> > Any ideas for a completely ignorant, non-developer type?
> >
> > Thanks in advance.
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> 
> create a small file with this code
> 
> 
> 
> which will tell you want modules are enabled in php
> 
> -- 
> 
> Bastien
> 
> Cat, the other other white meat
> 

He already mentioned that phpinfo() fails.

Thanks,
Ash
http://www.ashleysheridan.co.uk




[PHP] Re: PHP+Apache suddenly not working

2009-10-27 Thread Jason Lixfeld

On 2009-10-27, at 9:33 AM, Shawn McKenzie wrote:


Jason Lixfeld wrote:
I have no doubt that this is due to an update that was done on my  
system
at some point, but unfortunately I can't pinpoint where.  The  
upshot is
that PHP is completely unresponsive for me when run from Apache and  
I'm
not sure where to look.  I recognize that this isn't an apache  
support

list.  This message is being cc'd there too.



Are you sure you selected the Apache mod in make config?

1. go to /usr/ports/lang/php5
2. make deinstall
3. make config
4. select APACHE MODULES
5. select ok
6. make clean install


Yup.  Checked and double checked.  It's there.  Will do the make  
deinstall ; make clean install again though.


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



[PHP] Re: PHP+Apache suddenly not working

2009-10-27 Thread Shawn McKenzie
Jason Lixfeld wrote:
> I have no doubt that this is due to an update that was done on my system
> at some point, but unfortunately I can't pinpoint where.  The upshot is
> that PHP is completely unresponsive for me when run from Apache and I'm
> not sure where to look.  I recognize that this isn't an apache support
> list.  This message is being cc'd there too.


Are you sure you selected the Apache mod in make config?

 1. go to /usr/ports/lang/php5
 2. make deinstall
 3. make config
 4. select APACHE MODULES
 5. select ok
 6. make clean install

-- 
Thanks!
-Shawn
http://www.spidean.com

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



Re: [PHP] PHP+Apache suddenly not working

2009-10-27 Thread Bastien Koert
On Tue, Oct 27, 2009 at 9:18 AM, Jason Lixfeld
 wrote:
> I have no doubt that this is due to an update that was done on my system at
> some point, but unfortunately I can't pinpoint where.  The upshot is that
> PHP is completely unresponsive for me when run from Apache and I'm not sure
> where to look.  I recognize that this isn't an apache support list.  This
> message is being cc'd there too.
>
> The system is FreeBSD 6.1-RELEASE-p15.  PHP 5.2.11 from ports.
>
> The only error I get in my php log is this:
>
> [27-Oct-2009 13:05:00] PHP Fatal error:  Call to undefined function
> preg_match() in
> /usr/home/foo/public_html/cerb4/libs/devblocks/libs/zend_framework/Zend/Cache/Backend/File.php
> on line 125
>
> Now I've checked and double checked that pcre support is built into php.
>  I'm not sure if there's a command that I can run in php to show all the
> extensions that are installed or something, but I'm a bazillion percent sure
> that it's there, so I don't believe that's the cause of the error.  I'm
> reasonably sure of this because the preg_match error thrown every minute
> when a cron job runs, I have a .php that calls phpinfo() that shows a blank
> screen when hit from a browser.
>
> My problem is that I don't know how to troubleshoot this.
>
> I can seem to run PHP from the CLI just fine, so does this look more like an
> apache issue or perhaps some php module or extension that talks to apache?
>
> [r...@ricky /]# php
>  phpinfo();
> ?>
> phpinfo()
> PHP Version => 5.2.11
>
> System => FreeBSD ricky.arionetworks.ca 6.1-RELEASE-p15 FreeBSD
> 6.1-RELEASE-p15 #0: Sat Mar 31 11:43:34 EDT 2007
> jlixf...@ricky.arionetworks.ca:/usr/src/sys/amd64/compile/GENERIC amd64
> Build Date => Oct 26 2009 15:38:06
> Configure Command =>  './configure'  '--with-layout=GNU'
> '--with-config-file-scan-dir=/usr/local/etc/php' '--disable-all'
> '--enable-libxml' '--with-libxml-dir=/usr/local' '--enable-reflection'
> '--program-prefix=' '--enable-fastcgi' '--with-apxs2=/usr/local/sbin/apxs'
> '--with-regex=php' '--with-zend-vm=CALL' '--disable-ipv6'
> '--prefix=/usr/local' '--mandir=/usr/local/man' '--infodir=/usr/local/info/'
> '--build=amd64-portbld-freebsd6.1'
> Server API => Command Line Interface
> Virtual Directory Support => disabled
> Configuration File (php.ini) Path => /usr/local/etc
> Loaded Configuration File => /usr/local/etc/php.ini
> Scan this dir for additional .ini files => /usr/local/etc/php
> additional .ini files parsed => /usr/local/etc/php/extensions.ini
> ...
> ...
> ...
> etc
> ...
>
> [r...@ricky /]# pkg_info | grep php5
> php5-5.2.11_1       PHP Scripting Language
> php5-ctype-5.2.11_1 The ctype shared extension for php
> php5-dom-5.2.11_1   The dom shared extension for php
> php5-extensions-1.3 A "meta-port" to install PHP extensions
> php5-filter-5.2.11_1 The filter shared extension for php
> php5-gd-5.2.11_1    The gd shared extension for php
> php5-gettext-5.2.11_1 The gettext shared extension for php
> php5-iconv-5.2.11_1 The iconv shared extension for php
> php5-imap-5.2.11_1  The imap shared extension for php
> php5-ldap-5.2.11_1  The ldap shared extension for php
> php5-mbstring-5.2.11_1 The mbstring shared extension for php
> php5-mysql-5.2.11_1 The mysql shared extension for php
> php5-openssl-5.2.11_1 The openssl shared extension for php
> php5-pcre-5.2.11_1  The pcre shared extension for php
> php5-pdo-5.2.11_1   The pdo shared extension for php
> php5-pdo_sqlite-5.2.11_1 The pdo_sqlite shared extension for php
> php5-posix-5.2.11_1 The posix shared extension for php
> php5-session-5.2.11_1 The session shared extension for php
> php5-simplexml-5.2.11_1 The simplexml shared extension for php
> php5-spl-5.2.11_1   The spl shared extension for php
> php5-sqlite-5.2.11_1 The sqlite shared extension for php
> php5-tokenizer-5.2.11_1 The tokenizer shared extension for php
> php5-xml-5.2.11_1   The xml shared extension for php
> php5-xmlreader-5.2.11_1 The xmlreader shared extension for php
> php5-xmlwriter-5.2.11_1 The xmlwriter shared extension for php
> [r...@ricky /]#
>
> Any ideas for a completely ignorant, non-developer type?
>
> Thanks in advance.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

create a small file with this code



which will tell you want modules are enabled in php

-- 

Bastien

Cat, the other other white meat

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



[PHP] PHP+Apache suddenly not working

2009-10-27 Thread Jason Lixfeld
I have no doubt that this is due to an update that was done on my  
system at some point, but unfortunately I can't pinpoint where.  The  
upshot is that PHP is completely unresponsive for me when run from  
Apache and I'm not sure where to look.  I recognize that this isn't an  
apache support list.  This message is being cc'd there too.


The system is FreeBSD 6.1-RELEASE-p15.  PHP 5.2.11 from ports.

The only error I get in my php log is this:

[27-Oct-2009 13:05:00] PHP Fatal error:  Call to undefined function  
preg_match() in /usr/home/foo/public_html/cerb4/libs/devblocks/libs/ 
zend_framework/Zend/Cache/Backend/File.php on line 125


Now I've checked and double checked that pcre support is built into  
php.  I'm not sure if there's a command that I can run in php to show  
all the extensions that are installed or something, but I'm a  
bazillion percent sure that it's there, so I don't believe that's the  
cause of the error.  I'm reasonably sure of this because the  
preg_match error thrown every minute when a cron job runs, I have  
a .php that calls phpinfo() that shows a blank screen when hit from a  
browser.


My problem is that I don't know how to troubleshoot this.

I can seem to run PHP from the CLI just fine, so does this look more  
like an apache issue or perhaps some php module or extension that  
talks to apache?


[r...@ricky /]# php

phpinfo()
PHP Version => 5.2.11

System => FreeBSD ricky.arionetworks.ca 6.1-RELEASE-p15 FreeBSD 6.1- 
RELEASE-p15 #0: Sat Mar 31 11:43:34 EDT 2007  
jlixf...@ricky.arionetworks.ca:/usr/src/sys/amd64/compile/GENERIC amd64

Build Date => Oct 26 2009 15:38:06
Configure Command =>  './configure'  '--with-layout=GNU' '--with- 
config-file-scan-dir=/usr/local/etc/php' '--disable-all' '--enable- 
libxml' '--with-libxml-dir=/usr/local' '--enable-reflection' '-- 
program-prefix=' '--enable-fastcgi' '--with-apxs2=/usr/local/sbin/ 
apxs' '--with-regex=php' '--with-zend-vm=CALL' '--disable-ipv6' '-- 
prefix=/usr/local' '--mandir=/usr/local/man' '--infodir=/usr/local/ 
info/' '--build=amd64-portbld-freebsd6.1'

Server API => Command Line Interface
Virtual Directory Support => disabled
Configuration File (php.ini) Path => /usr/local/etc
Loaded Configuration File => /usr/local/etc/php.ini
Scan this dir for additional .ini files => /usr/local/etc/php
additional .ini files parsed => /usr/local/etc/php/extensions.ini
...
...
...
etc
...

[r...@ricky /]# pkg_info | grep php5
php5-5.2.11_1   PHP Scripting Language
php5-ctype-5.2.11_1 The ctype shared extension for php
php5-dom-5.2.11_1   The dom shared extension for php
php5-extensions-1.3 A "meta-port" to install PHP extensions
php5-filter-5.2.11_1 The filter shared extension for php
php5-gd-5.2.11_1The gd shared extension for php
php5-gettext-5.2.11_1 The gettext shared extension for php
php5-iconv-5.2.11_1 The iconv shared extension for php
php5-imap-5.2.11_1  The imap shared extension for php
php5-ldap-5.2.11_1  The ldap shared extension for php
php5-mbstring-5.2.11_1 The mbstring shared extension for php
php5-mysql-5.2.11_1 The mysql shared extension for php
php5-openssl-5.2.11_1 The openssl shared extension for php
php5-pcre-5.2.11_1  The pcre shared extension for php
php5-pdo-5.2.11_1   The pdo shared extension for php
php5-pdo_sqlite-5.2.11_1 The pdo_sqlite shared extension for php
php5-posix-5.2.11_1 The posix shared extension for php
php5-session-5.2.11_1 The session shared extension for php
php5-simplexml-5.2.11_1 The simplexml shared extension for php
php5-spl-5.2.11_1   The spl shared extension for php
php5-sqlite-5.2.11_1 The sqlite shared extension for php
php5-tokenizer-5.2.11_1 The tokenizer shared extension for php
php5-xml-5.2.11_1   The xml shared extension for php
php5-xmlreader-5.2.11_1 The xmlreader shared extension for php
php5-xmlwriter-5.2.11_1 The xmlwriter shared extension for php
[r...@ricky /]#

Any ideas for a completely ignorant, non-developer type?

Thanks in advance.

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



Re: [PHP] Apache Rewrite Issues

2009-10-08 Thread Ashley Sheridan
On Wed, 2009-10-07 at 16:49 -0400, Paul M Foster wrote:

> On Wed, Oct 07, 2009 at 11:52:00AM +0100, Russell Seymour wrote:
> 
> > Morning,
> >
> > I am trying to make my URLs more search engine friendly and I have come
> > up against a problem.
> >
> > I want the following URL:
> >
> > mysite.example.com/articles/Test Story
> >
> > to be proxied to
> >
> > mysite.example.com/index.php?m=articles&t=Test%20Story
> >
> 
> Aside from the solution to your problem (which I don't have), you might
> want to double-check on the "search engine friendliness" of URLs which
> contain query strings. I know at one time this was the case, but the
> latest I've heard is that URLs like your second one above are completely
> okay with search engines. If someone else knows different, please speak
> up.
> 
> And oh by the way, don't *ever* store a filename with a space in it on
> your computer. It's Evil(tm). I curse the idiot who first came up with
> allowing this in filenames. I have a special voodoo doll just for that
> person, when I find them. As you can see, it causes all manner of odd
> problems, no matter what OS it's on. (My local LUG list is periodically
> hit with messages from people trying to overcome the problems attendant
> to this habit.)
> 
> Paul
> 
> -- 
> Paul M. Foster
> 


I do a lot of research into SEO, and the only evidence I've found that
comes close to this is where a website set up a page containing a
fictional keyword in the URL, then searched for that word a week or two
later.

I don't know how valid the 'SEO friendly URLs' are though. How often
have you searched for the answer to a question online and had the top
few results turn out to be forums with dynamic query-string URLs?!

Thanks,
Ash
http://www.ashleysheridan.co.uk




Re: [PHP] Apache Rewrite Issues

2009-10-07 Thread Gaurav Kumar
Hey Russell,

After Going through all the threads in this post, it is correct to say, GET
Rid of the space. Use "-"  hyphen  for SEO friendly URL's. Its completely
OK.

Other thing which is very handy is urlencode and urldecode functions. When
you are sending a query string use urlencode function. This will preserve
the query string variable as "Test Story" and not as just "Test"; even if
there are spaces in the variable.

Gaurav Kumar
Tech Lead Open Source Solutions

On Wed, Oct 7, 2009 at 4:22 PM, Russell Seymour <
russell.seym...@turtlesystems.co.uk> wrote:

> Morning,
>
> I am trying to make my URLs more search engine friendly and I have come up
> against a problem.
>
> I want the following URL:
>
>mysite.example.com/articles/Test Story
>
> to be proxied to
>
>mysite.example.com/index.php?m=articles&t=Test%20Story
>
> I have the following rule in my Apache conf
>
>RewriteRule ^/articles/(.*) index.php?m=articles&t=$1 [P,L]
>
> Now if I run with this configuration, PHP strips the query string back at
> the space, so my query string ends up looking like
>
>[QUERY_STRING] =>  m=articles&t=Test
>
> even though the log file for the rewrite shows that the full query is being
> passed.
>
> But if I change the RewriteRule to be a Rewrite instead of a Proxy I get
>
>[QUERY_STRING] =>  m=articles&t=Test%20Story
>
> So something is happening when the system is proxying the request.
> Adding %20 into the URL does not fix the problem when proxy is enabled
> either.
>
> I have search around on the Internet, and people talk about using urlencode
> etc, this is fine when
> PHP is creating the URL but not when Apache is doing the rewrite.
>
> I apologise if people feel this is on the wrong list, but as far as I can
> tell from the rewrite logs the data is coming all
> the way through to PHP which is truncating it.  This is purely my
> observation.
>
> Apache version: 2.2.11
> PHP Version:5.3.0
>
> Any help is gratefully recieved.
>
> Thanks, Russell
>
>
>


Re: [PHP] Apache Rewrite Issues

2009-10-07 Thread Paul M Foster
On Wed, Oct 07, 2009 at 11:52:00AM +0100, Russell Seymour wrote:

> Morning,
>
> I am trying to make my URLs more search engine friendly and I have come
> up against a problem.
>
> I want the following URL:
>
> mysite.example.com/articles/Test Story
>
> to be proxied to
>
> mysite.example.com/index.php?m=articles&t=Test%20Story
>

Aside from the solution to your problem (which I don't have), you might
want to double-check on the "search engine friendliness" of URLs which
contain query strings. I know at one time this was the case, but the
latest I've heard is that URLs like your second one above are completely
okay with search engines. If someone else knows different, please speak
up.

And oh by the way, don't *ever* store a filename with a space in it on
your computer. It's Evil(tm). I curse the idiot who first came up with
allowing this in filenames. I have a special voodoo doll just for that
person, when I find them. As you can see, it causes all manner of odd
problems, no matter what OS it's on. (My local LUG list is periodically
hit with messages from people trying to overcome the problems attendant
to this habit.)

Paul

-- 
Paul M. Foster

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



Re: [PHP] Apache Rewrite Issues

2009-10-07 Thread Tommy Pham
- Original Message 
> From: Russell Seymour 
> To: php-general@lists.php.net
> Sent: Wed, October 7, 2009 3:52:00 AM
> Subject: [PHP] Apache Rewrite Issues
> 
> Morning,
> 
> I am trying to make my URLs more search engine friendly and I have come up 
> against a problem.
> 
> I want the following URL:
> 
> mysite.example.com/articles/Test Story
> 
> to be proxied to
> 
> mysite.example.com/index.php?m=articles&t=Test%20Story
> 

Russell,

Consider using a string function to replace the space with _ to be really 
SEF/SEO when generating the URL.  Thus, your problem also disappears ;)

Regards,
Tommy

> I have the following rule in my Apache conf
> 
> RewriteRule ^/articles/(.*) index.php?m=articles&t=$1 [P,L]
> 
> Now if I run with this configuration, PHP strips the query string back at the 
> space, so my query string ends up looking like
> 
> [QUERY_STRING] =>  m=articles&t=Test
> 
> even though the log file for the rewrite shows that the full query is being 
> passed.
> 
> But if I change the RewriteRule to be a Rewrite instead of a Proxy I get
> 
> [QUERY_STRING] =>  m=articles&t=Test%20Story
> 
> So something is happening when the system is proxying the request.
> Adding %20 into the URL does not fix the problem when proxy is enabled either.
> 
> I have search around on the Internet, and people talk about using urlencode 
> etc, 
> this is fine when
> PHP is creating the URL but not when Apache is doing the rewrite.
> 
> I apologise if people feel this is on the wrong list, but as far as I can 
> tell 
> from the rewrite logs the data is coming all
> the way through to PHP which is truncating it.  This is purely my observation.
> 
> Apache version:2.2.11
> PHP Version:5.3.0
> 
> Any help is gratefully recieved.
> 
> Thanks, Russell


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



[PHP] Apache Rewrite Issues

2009-10-07 Thread Russell Seymour

Morning,

I am trying to make my URLs more search engine friendly and I have come 
up against a problem.


I want the following URL:

mysite.example.com/articles/Test Story

to be proxied to

mysite.example.com/index.php?m=articles&t=Test%20Story

I have the following rule in my Apache conf

RewriteRule ^/articles/(.*) index.php?m=articles&t=$1 [P,L]

Now if I run with this configuration, PHP strips the query string back 
at the space, so my query string ends up looking like


[QUERY_STRING] =>  m=articles&t=Test

even though the log file for the rewrite shows that the full query is being 
passed.

But if I change the RewriteRule to be a Rewrite instead of a Proxy I get

[QUERY_STRING] =>  m=articles&t=Test%20Story

So something is happening when the system is proxying the request.
Adding %20 into the URL does not fix the problem when proxy is enabled either.

I have search around on the Internet, and people talk about using urlencode 
etc, this is fine when
PHP is creating the URL but not when Apache is doing the rewrite.

I apologise if people feel this is on the wrong list, but as far as I can tell 
from the rewrite logs the data is coming all
the way through to PHP which is truncating it.  This is purely my observation.

Apache version: 2.2.11
PHP Version:5.3.0

Any help is gratefully recieved.

Thanks, Russell




Re: [PHP] Apache module PHP 5.3 on Windows

2009-07-02 Thread Lester Caine

Jonathan Tapicer wrote:

What version, VC6 or VC9, TS or NTS? I use VC6 TS and the dll is there...


Of cause no one has asked yet which version you use if you have to test 
BOTH Apache and IIS ;)


--
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php

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



Re: [PHP] Apache module PHP 5.3 on Windows

2009-07-01 Thread Pablo Viquez

Sorry my mistake, I was looking in the wrong built.

Thank you!

- Original Message - 
From: "Adam Shannon" 

Newsgroups: php.general
To: "Jonathan Tapicer" 
Cc: "Pablo Viquez" ; 
Sent: Wednesday, July 01, 2009 5:50 PM
Subject: Re: [PHP] Apache module PHP 5.3 on Windows


Yes, you need to use the V6 installer, I did the same thing with the V9 
and

it won't work.  Only after uninstalling PHP did I see that line of text
saying which one to use...

On Wed, Jul 1, 2009 at 5:54 PM, Jonathan Tapicer  
wrote:



What version, VC6 or VC9, TS or NTS? I use VC6 TS and the dll is there...

On Wed, Jul 1, 2009 at 7:31 PM, Pablo Viquez
wrote:
> Hi,
>
> I just downloaded the new stable version of PHP 5.3 and I couldnt find
the
> php5apache2_2.dll file.
>
> Is the apache module on windows no longer supported?
>
> Thanks!
> --
> 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





--
- Adam Shannon ( http://ashannon.us )




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



Re: [PHP] Apache module PHP 5.3 on Windows

2009-07-01 Thread Adam Shannon
Yes, you need to use the V6 installer, I did the same thing with the V9 and
it won't work.  Only after uninstalling PHP did I see that line of text
saying which one to use...

On Wed, Jul 1, 2009 at 5:54 PM, Jonathan Tapicer  wrote:

> What version, VC6 or VC9, TS or NTS? I use VC6 TS and the dll is there...
>
> On Wed, Jul 1, 2009 at 7:31 PM, Pablo Viquez
> wrote:
> > Hi,
> >
> > I just downloaded the new stable version of PHP 5.3 and I couldnt find
> the
> > php5apache2_2.dll file.
> >
> > Is the apache module on windows no longer supported?
> >
> > Thanks!
> > --
> > 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
>
>


-- 
- Adam Shannon ( http://ashannon.us )


Re: [PHP] Apache module PHP 5.3 on Windows

2009-07-01 Thread Jonathan Tapicer
What version, VC6 or VC9, TS or NTS? I use VC6 TS and the dll is there...

On Wed, Jul 1, 2009 at 7:31 PM, Pablo Viquez wrote:
> Hi,
>
> I just downloaded the new stable version of PHP 5.3 and I couldnt find the
> php5apache2_2.dll file.
>
> Is the apache module on windows no longer supported?
>
> Thanks!
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

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



[PHP] Apache module PHP 5.3 on Windows

2009-07-01 Thread Pablo Viquez

Hi,

I just downloaded the new stable version of PHP 5.3 and I couldnt find the 
php5apache2_2.dll file.


Is the apache module on windows no longer supported?

Thanks! 


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



Re: [PHP] apache user cannot execute useradd via sudo :(

2009-05-22 Thread Michael A. Peters

vuthecuong wrote:





Yeah I know my script don't care at all about security. I'm keeping it fot
the sake of simplicity.
After making it 'work', I will take a look seriously about security.
So, why it not create user for me?
thanks and regards


I'm not that familiar with sudo, but I suspect it may have to do with 
the fact apache is a user without a shell.


look in the sudo log file.
If you don't see anything, look in /var/log/secure and /var/log/messages 
and /var/log/httpd/error_log


If you don't see the problem, log into a root shell. Then run

su apache

to become the apache user and try the command and see what happens.

Really though, this isn't a job for sudo.
It's a job for a suid root shell script (I'd suggest perl or python or 
maybe tcl/expect).


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



Re: [PHP] apache user cannot execute useradd via sudo :(

2009-05-22 Thread vuthecuong



Michael A. Peters wrote:
> 
> vuthecuong wrote:
>> 
>> Hi all
>> My server is centos 5.1 with php 5.1.6.
>> In my app I want apache to add user through sudo.
>> 
>> My sudoers file is:
>> %apache ALL=(ALL) NOPASSWD: ALL
>> %tony ALL=(ALL) NOPASSWD: ALL
>> 
>> My test.php í:
>> > $username="hixhix";
>> system("/usr/bin/sudo /usr/sbin/useradd -s /sbin/nologin -M
>> $username",$returnvalue);
>> echo "return value: $returnvalue";
>> However, user 'hixhix' not created by apache at all, it always returned
>> 1.
>> how can I make my apache tu add user using sudo?
>> Please help me. I need your help.
>> Thanks and regards.
> 
> That's not a very secure sudoers file.
> 
> But you probably don't want to use sudo to this anyway.
> 
> What you probably should do is write a shell script (IE w/ perl) that is 
> suid root and executable by apache that adds the user to your system.
> 
> I don't know what your sudo error is, but have you looked at your sudo 
> log file?
> 
> Make damn sure you validate the $username variable whatever solution you 
> end up using.
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 
Yeah I know my script don't care at all about security. I'm keeping it fot
the sake of simplicity.
After making it 'work', I will take a look seriously about security.
So, why it not create user for me?
thanks and regards
-- 
View this message in context: 
http://www.nabble.com/apache-user-cannot-execute-useradd-via-sudo-%3A%28-tp23668764p23680766.html
Sent from the PHP - General mailing list archive at Nabble.com.


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



Re: [PHP] apache user cannot execute useradd via sudo :(

2009-05-22 Thread Ashley Sheridan
On Fri, 2009-05-22 at 05:01 -0700, Michael A. Peters wrote:
> Make damn sure you validate the $username variable whatever solution
> you 
> end up using. 

Yeah, I have a funny story along those lines. I was doing the same sort
of thing, but allowing it to change passwords for a user. Luckily it was
an internal system, but I was still miffed at the smart-alec who thought
it would be funny to change the root password! Needless to say, I added
a lot of safeguards into the both the PHP script and the Bash script to
protect the system users and enforce a strict naming policy on what was
allowed to change, so that only users in the form 'prefix_joebloggs',
'prefix_simon', etc were allowed. Luckily the system was all still in
testing when that little gem was found. I hit myself for being so stupid
afterwards!


Ash
www.ashleysheridan.co.uk


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



Re: [PHP] apache user cannot execute useradd via sudo :(

2009-05-22 Thread Michael A. Peters

vuthecuong wrote:


Hi all
My server is centos 5.1 with php 5.1.6.
In my app I want apache to add user through sudo.

My sudoers file is:
%apache ALL=(ALL) NOPASSWD: ALL
%tony ALL=(ALL) NOPASSWD: ALL

My test.php í:


That's not a very secure sudoers file.

But you probably don't want to use sudo to this anyway.

What you probably should do is write a shell script (IE w/ perl) that is 
suid root and executable by apache that adds the user to your system.


I don't know what your sudo error is, but have you looked at your sudo 
log file?


Make damn sure you validate the $username variable whatever solution you 
end up using.


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



[PHP] apache user cannot execute useradd via sudo :(

2009-05-22 Thread vuthecuong


Hi all
My server is centos 5.1 with php 5.1.6.
In my app I want apache to add user through sudo.

My sudoers file is:
%apache ALL=(ALL) NOPASSWD: ALL
%tony ALL=(ALL) NOPASSWD: ALL

My test.php í:
http://www.nabble.com/apache-user-cannot-execute-useradd-via-sudo-%3A%28-tp23668764p23668764.html
Sent from the PHP - General mailing list archive at Nabble.com.


Re: [PHP] Apache question

2009-03-20 Thread Daniel Brown
On Fri, Mar 20, 2009 at 17:27, Ernie Kemp  wrote:
>
> Please point me in the right direction with this as this is becoming a pain
> in the butt.

Ernie,

Check in with the Apache folks:

http://httpd.apache.org/lists.html

-- 

daniel.br...@parasane.net || danbr...@php.net
http://www.parasane.net/ || http://www.pilotpig.net/
50% Off All Shared Hosting Plans at PilotPig: Use Coupon DOW1

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



[PHP] Apache question

2009-03-20 Thread Ernie Kemp
 

Sometime when I run the program http://localhost/DigitalBiz4U/index.php in a
browser this message come up and the page is not displayed.

 



"Apache HTTP Server stopped working and was closed" message on screen.

 

Apache version: Apache2.2.11

PHP version: 5.2.8

OS:  Vista

IIS is turned off on system.

 

I have tried reloading to a different version of Apache and PHP with no
success.

 

Sample of error log.

[Fri Mar 20 17:10:04 2009] [notice] Parent: child process exited with status
255 -- Restarting.

[Fri Mar 20 17:10:05 2009] [notice] Apache/2.2.11 (Win32) PHP/5.2.8
configured -- resuming normal operations

[Fri Mar 20 17:10:05 2009] [notice] Server built: Dec 10 2008 00:10:06

[Fri Mar 20 17:10:05 2009] [notice] Parent: Created child process 4924

[Fri Mar 20 17:10:05 2009] [notice] Child 4924: Child process is running

[Fri Mar 20 17:10:05 2009] [notice] Child 4924: Acquired the start mutex.

[Fri Mar 20 17:10:05 2009] [notice] Child 4924: Starting 64 worker threads.

[Fri Mar 20 17:10:05 2009] [notice] Child 4924: Starting thread to listen on
port 80.

 

Tried to find solution on the web, no help.

Please point me in the right direction with this as this is becoming a pain
in the butt.

 

Thanks,

/Ernie



Re: [PHP] Re: PHP/Apache: script unexpectedly invoked multiple times in parallel every 30 secs.

2009-03-11 Thread Michael A. Peters

Nathan Rixham wrote:

Marc Venturini wrote:

Hi all,

Thank you all very much for your contributions.

I tried to monitor the network with Wireshark: there is only one request
from my browser to the server, and not any answer (redirect or 
otherwise).
This means the problem is definitely not with unexpected browser 
requests.


Calling die() at the end of the script and removing the redirect did not
change the behavior in any way.

I like to think my code is good, and that the server calls the script 
in an

unexpected way. The main reason for this belief is that I do not use
multithreading at all, while the logs report the script is running 
several
times in parallel and the network monitor reports a single browser 
request.
I could not find in the docs any server configuration parameter which 
would

re-invoke a script without killing its currently running instance.



are you forking the script at all? if so you can't unless on the cli



I don't know what is causing it, but is the site live? If so, could it 
be a proxy somewhere re-requesting the data when it thinks your server 
has timed out? I guess you ruled that out with the wireshark.


If it really takes over 30 seconds to process the images, would it 
better to just have your script cue the images and exit, with 
ImageMagick running on the server to do the actual hard work?


Write a shell script that cron runs every 5 minutes.
The script wgets a shell script from your server with the cue of what 
needs to be processed and then processes it.


I don't know for sure, but I suspect using ImageMagick in a shell script 
is going to be less resource intensive than the web server doing it. 
Doing it that way lets your script exit much sooner and would avoid 
impatient user reloads, which could be a problem even when you do figure 
out this issue.


I almost wonder if Apache has some directive that tries to serve the 
data again if it thinks there was a backend problem with it's first request.


What happens when you try to request your page with wget or lynx?
They won't try to load any images, so if there is a image src problem 
that should make it obvious.


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



Re: [PHP] Re: PHP/Apache: script unexpectedly invoked multiple times in parallel every 30 secs.

2009-03-11 Thread Nathan Rixham

Marc Venturini wrote:

Hi all,

Thank you all very much for your contributions.

I tried to monitor the network with Wireshark: there is only one request
from my browser to the server, and not any answer (redirect or otherwise).
This means the problem is definitely not with unexpected browser requests.

Calling die() at the end of the script and removing the redirect did not
change the behavior in any way.

I like to think my code is good, and that the server calls the script in an
unexpected way. The main reason for this belief is that I do not use
multithreading at all, while the logs report the script is running several
times in parallel and the network monitor reports a single browser request.
I could not find in the docs any server configuration parameter which would
re-invoke a script without killing its currently running instance.



are you forking the script at all? if so you can't unless on the cli

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



Re: [PHP] Re: PHP/Apache: script unexpectedly invoked multiple times in parallel every 30 secs.

2009-03-11 Thread Marc Venturini
Hi all,

Thank you all very much for your contributions.

I tried to monitor the network with Wireshark: there is only one request
from my browser to the server, and not any answer (redirect or otherwise).
This means the problem is definitely not with unexpected browser requests.

Calling die() at the end of the script and removing the redirect did not
change the behavior in any way.

I like to think my code is good, and that the server calls the script in an
unexpected way. The main reason for this belief is that I do not use
multithreading at all, while the logs report the script is running several
times in parallel and the network monitor reports a single browser request.
I could not find in the docs any server configuration parameter which would
re-invoke a script without killing its currently running instance.

Unfortunately I cannot post the code here, as everything is spread in
several files. If stuck with this issue for too long, I'll consider reducing
the script to the root cause of the problem and posting it, but it's toomuch
overhead at this stage...

Cheers,
Marc.


On Wed, Mar 11, 2009 at 4:40 PM, haliphax  wrote:

> On Wed, Mar 11, 2009 at 10:30 AM, Martin Zvarík  wrote:
> > Marc Venturini napsal(a):
> >>
> >> Hi all,
> >>
> >> I wrote a PHP script running in Apache which takes more than 30 seconds
> to
> >> complete. It uses set_time_limit() to extend the time it is allowed to
> >> run.
> >> The script generates thumbnails from a list of images. Upon completion,
> >> the
> >> script redirects the browser to another page using HTTP headers.
> >
> > If you die() at the end of the script and don't redirect does it continue
> > this auto-30-seconds execution?
> >
> >>
> >> On my local machine (Windows + EasyPHP), the script runs as expected and
> >> completes after a few minutes.
> >>
> >> I observe an unexpected behavior on my production web server:
> >> - The script runs as expected for the first 30 seconds.
> >> - After 30 seconds, the same script with the same parameters starts
> again
> >> in
> >> a new thread/process. The initial thread/process is *not* interrupted,
> so
> >> 2
> >> threads/processes run in parallel, executing the same sequence of
> >> operations
> >> with a 30 time shift.
> >> - The same scenario happens every 30 seconds (i.e.: at 0"30, 1"00, 1"30,
> >> and
> >> so on), multiplying the parallel threads/processes.
> >
> >> - The browser keeps on loading while the above happens.
> >
> >> - After some time, the browser displays a blank page and all the
> >> threads/processes stop. I assume this is due to resources exhaustion,
> but
> >> I
> >> have no means to check this assumption.
> >>
> >> I deduced the above reading a text file in which I log the sequence of
> >> called functions.
> >
> > It all seems as a redirection / unclosed loop problem.
> >
> >>
> >> Unfortunately I have no access *at all* to my production web server
> >> configuration (shared hosting, no documentation). I cannot even read the
> >> configuration settings. While I'm considering moving to another host,
> I'd
> >> be
> >> extremely pleased to have an explanation of the observed behavior.
> >>
> >> I have browsed the mailing list archives and looked for an explanation
> in
> >> other forums to no avail. This thread may deal with the same issue but
> >> does
> >> not include any explanation or solution:
> >> http://www.networkedmediatank.com/showthread.php?tid=17140
> >>
> >> Thanks for reading, and please do not hesitate to ask for further
> >> explanations if what I'm trying to achieve was not clear!
> >
> > Why it works on your local server is probably caused by different
> > versions/settings, but I bet there's an error somewhere in your script.
> >
> > Consider sending it here, I'll take a look.
>
> A blank URL does not redirect to the directory index, IIRC... it
> refreshes the current page (such as a FORM tag with ACTION=""). This
> may very well still be your problem.
>
> My 2c,
>
>
> --
> // Todd
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


Re: [PHP] Re: PHP/Apache: script unexpectedly invoked multiple times in parallel every 30 secs.

2009-03-11 Thread haliphax
On Wed, Mar 11, 2009 at 10:30 AM, Martin Zvarík  wrote:
> Marc Venturini napsal(a):
>>
>> Hi all,
>>
>> I wrote a PHP script running in Apache which takes more than 30 seconds to
>> complete. It uses set_time_limit() to extend the time it is allowed to
>> run.
>> The script generates thumbnails from a list of images. Upon completion,
>> the
>> script redirects the browser to another page using HTTP headers.
>
> If you die() at the end of the script and don't redirect does it continue
> this auto-30-seconds execution?
>
>>
>> On my local machine (Windows + EasyPHP), the script runs as expected and
>> completes after a few minutes.
>>
>> I observe an unexpected behavior on my production web server:
>> - The script runs as expected for the first 30 seconds.
>> - After 30 seconds, the same script with the same parameters starts again
>> in
>> a new thread/process. The initial thread/process is *not* interrupted, so
>> 2
>> threads/processes run in parallel, executing the same sequence of
>> operations
>> with a 30 time shift.
>> - The same scenario happens every 30 seconds (i.e.: at 0"30, 1"00, 1"30,
>> and
>> so on), multiplying the parallel threads/processes.
>
>> - The browser keeps on loading while the above happens.
>
>> - After some time, the browser displays a blank page and all the
>> threads/processes stop. I assume this is due to resources exhaustion, but
>> I
>> have no means to check this assumption.
>>
>> I deduced the above reading a text file in which I log the sequence of
>> called functions.
>
> It all seems as a redirection / unclosed loop problem.
>
>>
>> Unfortunately I have no access *at all* to my production web server
>> configuration (shared hosting, no documentation). I cannot even read the
>> configuration settings. While I'm considering moving to another host, I'd
>> be
>> extremely pleased to have an explanation of the observed behavior.
>>
>> I have browsed the mailing list archives and looked for an explanation in
>> other forums to no avail. This thread may deal with the same issue but
>> does
>> not include any explanation or solution:
>> http://www.networkedmediatank.com/showthread.php?tid=17140
>>
>> Thanks for reading, and please do not hesitate to ask for further
>> explanations if what I'm trying to achieve was not clear!
>
> Why it works on your local server is probably caused by different
> versions/settings, but I bet there's an error somewhere in your script.
>
> Consider sending it here, I'll take a look.

A blank URL does not redirect to the directory index, IIRC... it
refreshes the current page (such as a FORM tag with ACTION=""). This
may very well still be your problem.

My 2c,


-- 
// Todd

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



[PHP] Re: PHP/Apache: script unexpectedly invoked multiple times in parallel every 30 secs.

2009-03-11 Thread Martin Zvarík

Marc Venturini napsal(a):

Hi all,

I wrote a PHP script running in Apache which takes more than 30 seconds to
complete. It uses set_time_limit() to extend the time it is allowed to run.
The script generates thumbnails from a list of images. Upon completion, the
script redirects the browser to another page using HTTP headers.


If you die() at the end of the script and don't redirect does it 
continue this auto-30-seconds execution?




On my local machine (Windows + EasyPHP), the script runs as expected and
completes after a few minutes.

I observe an unexpected behavior on my production web server:
- The script runs as expected for the first 30 seconds.
- After 30 seconds, the same script with the same parameters starts again in
a new thread/process. The initial thread/process is *not* interrupted, so 2
threads/processes run in parallel, executing the same sequence of operations
with a 30 time shift.
- The same scenario happens every 30 seconds (i.e.: at 0"30, 1"00, 1"30, and
so on), multiplying the parallel threads/processes.



- The browser keeps on loading while the above happens.



- After some time, the browser displays a blank page and all the
threads/processes stop. I assume this is due to resources exhaustion, but I
have no means to check this assumption.

I deduced the above reading a text file in which I log the sequence of
called functions.


It all seems as a redirection / unclosed loop problem.



Unfortunately I have no access *at all* to my production web server
configuration (shared hosting, no documentation). I cannot even read the
configuration settings. While I'm considering moving to another host, I'd be
extremely pleased to have an explanation of the observed behavior.

I have browsed the mailing list archives and looked for an explanation in
other forums to no avail. This thread may deal with the same issue but does
not include any explanation or solution:
http://www.networkedmediatank.com/showthread.php?tid=17140

Thanks for reading, and please do not hesitate to ask for further
explanations if what I'm trying to achieve was not clear!


Why it works on your local server is probably caused by different 
versions/settings, but I bet there's an error somewhere in your script.


Consider sending it here, I'll take a look.



Cheers,
Marc.



Martin

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



Re: [PHP] PHP/Apache: script unexpectedly invoked multiple times in parallel every 30 secs.

2009-03-11 Thread Marc Venturini
Thanks for your contribution Virgil. Unfortunately my file is not index.php
(nor anything else declared in a DirectoryIndex directive).

I'm planning to fix the issue using a lock to test that the script is not
already running before starting it again, but I would like to find out the
explanation for this unexpected behavior!

Cheers,
Marc.


On Wed, Mar 11, 2009 at 1:08 PM, Virgilio Quilario <
virgilio.quila...@gmail.com> wrote:

> > Hi all,
> >
> > I wrote a PHP script running in Apache which takes more than 30 seconds
> to
> > complete. It uses set_time_limit() to extend the time it is allowed to
> run.
> > The script generates thumbnails from a list of images. Upon completion,
> the
> > script redirects the browser to another page using HTTP headers.
> >
> > On my local machine (Windows + EasyPHP), the script runs as expected and
> > completes after a few minutes.
> >
> > I observe an unexpected behavior on my production web server:
> > - The script runs as expected for the first 30 seconds.
> > - After 30 seconds, the same script with the same parameters starts again
> in
> > a new thread/process. The initial thread/process is *not* interrupted, so
> 2
> > threads/processes run in parallel, executing the same sequence of
> operations
> > with a 30 time shift.
> > - The same scenario happens every 30 seconds (i.e.: at 0"30, 1"00, 1"30,
> and
> > so on), multiplying the parallel threads/processes.
> > - The browser keeps on loading while the above happens.
> > - After some time, the browser displays a blank page and all the
> > threads/processes stop. I assume this is due to resources exhaustion, but
> I
> > have no means to check this assumption.
> >
> > I deduced the above reading a text file in which I log the sequence of
> > called functions.
> >
> > Unfortunately I have no access *at all* to my production web server
> > configuration (shared hosting, no documentation). I cannot even read the
> > configuration settings. While I'm considering moving to another host, I'd
> be
> > extremely pleased to have an explanation of the observed behavior.
> >
> > I have browsed the mailing list archives and looked for an explanation in
> > other forums to no avail. This thread may deal with the same issue but
> does
> > not include any explanation or solution:
> > http://www.networkedmediatank.com/showthread.php?tid=17140
> >
> > Thanks for reading, and please do not hesitate to ask for further
> > explanations if what I'm trying to achieve was not clear!
> >
> > Cheers,
> > Marc.
> >
>
> hi Marc,
>
> probably your php file on your production server is index.php.
> and you must have generated a image tag with empty src like below:
> 
>
> with src being empty, browsers will load your index.php as if it was
> an image url so loading in parallel.
> hope this explains your case.
>
> Virgil
> http://www.jampmark.com
> Free tips, tutorials, innovative tools and techniques for building and
> improving web sites.
>


Re: [PHP] PHP/Apache: script unexpectedly invoked multiple times in parallel every 30 secs.

2009-03-11 Thread Virgilio Quilario
> Hi all,
>
> I wrote a PHP script running in Apache which takes more than 30 seconds to
> complete. It uses set_time_limit() to extend the time it is allowed to run.
> The script generates thumbnails from a list of images. Upon completion, the
> script redirects the browser to another page using HTTP headers.
>
> On my local machine (Windows + EasyPHP), the script runs as expected and
> completes after a few minutes.
>
> I observe an unexpected behavior on my production web server:
> - The script runs as expected for the first 30 seconds.
> - After 30 seconds, the same script with the same parameters starts again in
> a new thread/process. The initial thread/process is *not* interrupted, so 2
> threads/processes run in parallel, executing the same sequence of operations
> with a 30 time shift.
> - The same scenario happens every 30 seconds (i.e.: at 0"30, 1"00, 1"30, and
> so on), multiplying the parallel threads/processes.
> - The browser keeps on loading while the above happens.
> - After some time, the browser displays a blank page and all the
> threads/processes stop. I assume this is due to resources exhaustion, but I
> have no means to check this assumption.
>
> I deduced the above reading a text file in which I log the sequence of
> called functions.
>
> Unfortunately I have no access *at all* to my production web server
> configuration (shared hosting, no documentation). I cannot even read the
> configuration settings. While I'm considering moving to another host, I'd be
> extremely pleased to have an explanation of the observed behavior.
>
> I have browsed the mailing list archives and looked for an explanation in
> other forums to no avail. This thread may deal with the same issue but does
> not include any explanation or solution:
> http://www.networkedmediatank.com/showthread.php?tid=17140
>
> Thanks for reading, and please do not hesitate to ask for further
> explanations if what I'm trying to achieve was not clear!
>
> Cheers,
> Marc.
>

hi Marc,

probably your php file on your production server is index.php.
and you must have generated a image tag with empty src like below:


with src being empty, browsers will load your index.php as if it was
an image url so loading in parallel.
hope this explains your case.

Virgil
http://www.jampmark.com
Free tips, tutorials, innovative tools and techniques for building and
improving web sites.

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



[PHP] PHP/Apache: script unexpectedly invoked multiple times in parallel every 30 secs.

2009-03-10 Thread Marc Venturini
Hi all,

I wrote a PHP script running in Apache which takes more than 30 seconds to
complete. It uses set_time_limit() to extend the time it is allowed to run.
The script generates thumbnails from a list of images. Upon completion, the
script redirects the browser to another page using HTTP headers.

On my local machine (Windows + EasyPHP), the script runs as expected and
completes after a few minutes.

I observe an unexpected behavior on my production web server:
- The script runs as expected for the first 30 seconds.
- After 30 seconds, the same script with the same parameters starts again in
a new thread/process. The initial thread/process is *not* interrupted, so 2
threads/processes run in parallel, executing the same sequence of operations
with a 30 time shift.
- The same scenario happens every 30 seconds (i.e.: at 0"30, 1"00, 1"30, and
so on), multiplying the parallel threads/processes.
- The browser keeps on loading while the above happens.
- After some time, the browser displays a blank page and all the
threads/processes stop. I assume this is due to resources exhaustion, but I
have no means to check this assumption.

I deduced the above reading a text file in which I log the sequence of
called functions.

Unfortunately I have no access *at all* to my production web server
configuration (shared hosting, no documentation). I cannot even read the
configuration settings. While I'm considering moving to another host, I'd be
extremely pleased to have an explanation of the observed behavior.

I have browsed the mailing list archives and looked for an explanation in
other forums to no avail. This thread may deal with the same issue but does
not include any explanation or solution:
http://www.networkedmediatank.com/showthread.php?tid=17140

Thanks for reading, and please do not hesitate to ask for further
explanations if what I'm trying to achieve was not clear!

Cheers,
Marc.


Re: [PHP] PHP & Apache - Consuming Too much memory

2009-03-05 Thread Chris

Shota Gedenidze wrote:

Php and apache memory problem.

I have apache and php, recently added APC module to php, and after
that each apache process consumes 30-100 mb of resident memory.
Operating System is Linux.
Does anybody have Idea how to optimize php to consume less memory?


ini_set('memory_limit', '32M');

fix what it complains about when you view your site/application/whatever 
and says you're using too much memory.


There's no hard & fast rule here - it's all down to time, patience and 
lots of effort.


You could also use xdebug to profile your app and see where to start.

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


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



[PHP] PHP & Apache - Consuming Too much memory

2009-03-05 Thread Shota Gedenidze
Php and apache memory problem.

I have apache and php, recently added APC module to php, and after
that each apache process consumes 30-100 mb of resident memory.
Operating System is Linux.
Does anybody have Idea how to optimize php to consume less memory?

Your help is greatly appreciated,
Thank you.

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



Re: [PHP] Apache odd behavior

2009-02-17 Thread Stuart
2009/2/17 Paul M Foster :
> Well, the only way I know this is to look at the Apache logs. I was
> getting a lot of 3xx and 4xx errors (which don't show up directly in the
> browser), and looking at the requests, it appears that the browser is
> indeed dictating the place to find images, etc., based on the odd URL.

If you don't already have it get Firefox. Once you have that google
for the livehttpheaders extension. Using that you can see exactly what
the browser is asking the server for, including all headers.

-Stuart

-- 
http://stut.net/

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



Re: [PHP] Apache odd behavior

2009-02-17 Thread Paul M Foster
On Tue, Feb 17, 2009 at 12:27:58PM +, Stuart wrote:

> 2009/2/17 Paul M Foster :
> > On Mon, Feb 16, 2009 at 08:34:22PM +, Stuart wrote:
> >
> > 
> >
> >> This is your problem, you're not understanding where the paths are
> >> being resolved. Apache has absolutely no involvement in resolving
> >> relative paths in your HTML files to absolute URLs. The browser does
> >> this. All you need to do is use absolute URLs and everything will work
> >> fine. By absolute, in case you don't know, I mean starting with a /
> >> and being "from" the document root in the web server.
> >
> > FWIW, I've been doing computers since before the CP/M days
> > (pre-pre-DOS), so I do know the difference between absolute and relative
> > paths.
> 
> FWIW I've been "doing" computers for a long time also, and am well
> aware of CP/M. Based on what you said it didn't appear that you did
> know the difference, but I apologise for the mistake. I'm sure if you
> look at the URLs being requested by the browser it should be pretty
> clear that it's simply adding the paths you have in your HTML to the
> end of the existing URL. The fact that you didn't appear to have seen
> that informed my assumption.

Well, the only way I know this is to look at the Apache logs. I was
getting a lot of 3xx and 4xx errors (which don't show up directly in the
browser), and looking at the requests, it appears that the browser is
indeed dictating the place to find images, etc., based on the odd URL.

> 
> > I'm a little doubtful about the browser specifying things like the URLs
> > for links within a HTML page. However, this would explain why there are
> > separate entries for image fetches in the Apache logs, occurring after
> > the main page has been requested. Do you have some reference for this?
> > I'd like to read more about the server-client interaction in depth.
> 
> I couldn't find any references so I wrote a quick overview of what the
> process is. Note that this is over-simplified but should get the basic
> process across.
> 
> * Browser connects to the HTTP server on www.google.com and requests /
> 
> * Server resolves / to a resource, commonly an HTML file, PHP script
> or whatever, processes it if necessary and sends the output back to
> the browser.
> 
> * Browser receives the HTML content, parses it, builds a list of
> referenced URLs (images, scripts, stylesheets, etc)
> 
> * Browser normalises each referenced URL according to a fairly simple
> set of rules...
> 
>   If the URL is not already in the form scheme://...
>   If the URL does not start with a /
>   // The URL is relative to the current location
>   If current_url ends with /
>   URL = current_url + URL
>   Else
>   URL = dirname(current_url) + '/' + URL
>   Fi
>   Else
>   // The URL is absolute on the current domain
>   // current_domain is everything needed to hit the
>   same web server,
> so scheme://[[username]:passw...@]domain.com
>   URL = current_domain + URL
>   Fi
>   Else
>   // URL is already absolute, including the scheme, domain
>   name, etc
>   Fi
> 
> * Browser then (usually) fires off a couple of threads to request the
> additional URLs, renders the page and executes any scripts it
> contains.
> 
> The server has absolutely no involvement in resolving referenced URLs
> to complete URLs - this is all done by the browser. HTTP is stateless
> to the extreme, meaning that each request gets a single resource, even
> if they're done through the same connection.
> 
> Hope that makes it clearer.

Thanks for the summary.



> >
> > So specifying absolute links might be a bit much. I'm not happy with the
> > way DW handles this stuff, but I have to strike a balance between my
> > vim-handcoding-command-line method and my wife's
> > click-and-drag-gotta-be-GUI method.
> 
> We've covered this in the other thread. I can't speak for DW since
> I've only ever used it as a text editor, and even then only when
> forced, but I would be surprised if you couldn't tell it to generate
> absolute URLs. Something I do know is that you can set it up to
> automatically deploy to a separate virtual host on your development
> server, but based on the other thread you've already made a decision
> on how to solve your problem.

I leave Dreamweaver issues to my wife. She maintains she can manually
type in the link URLs, but that's really not a good ongoing paradigm.
Now, if Dreamweaver had a config setting that said, "Make all URLs
absolute", I'd say that's the best resolution.

Paul

-- 
Paul M. Foster

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



Re: [PHP] Apache odd behavior

2009-02-17 Thread Stuart
2009/2/17 Paul M Foster :
> On Mon, Feb 16, 2009 at 08:34:22PM +, Stuart wrote:
>
> 
>
>> This is your problem, you're not understanding where the paths are
>> being resolved. Apache has absolutely no involvement in resolving
>> relative paths in your HTML files to absolute URLs. The browser does
>> this. All you need to do is use absolute URLs and everything will work
>> fine. By absolute, in case you don't know, I mean starting with a /
>> and being "from" the document root in the web server.
>
> FWIW, I've been doing computers since before the CP/M days
> (pre-pre-DOS), so I do know the difference between absolute and relative
> paths.

FWIW I've been "doing" computers for a long time also, and am well
aware of CP/M. Based on what you said it didn't appear that you did
know the difference, but I apologise for the mistake. I'm sure if you
look at the URLs being requested by the browser it should be pretty
clear that it's simply adding the paths you have in your HTML to the
end of the existing URL. The fact that you didn't appear to have seen
that informed my assumption.

> I'm a little doubtful about the browser specifying things like the URLs
> for links within a HTML page. However, this would explain why there are
> separate entries for image fetches in the Apache logs, occurring after
> the main page has been requested. Do you have some reference for this?
> I'd like to read more about the server-client interaction in depth.

I couldn't find any references so I wrote a quick overview of what the
process is. Note that this is over-simplified but should get the basic
process across.

* Browser connects to the HTTP server on www.google.com and requests /

* Server resolves / to a resource, commonly an HTML file, PHP script
or whatever, processes it if necessary and sends the output back to
the browser.

* Browser receives the HTML content, parses it, builds a list of
referenced URLs (images, scripts, stylesheets, etc)

* Browser normalises each referenced URL according to a fairly simple
set of rules...

If the URL is not already in the form scheme://...
If the URL does not start with a /
// The URL is relative to the current location
If current_url ends with /
URL = current_url + URL
Else
URL = dirname(current_url) + '/' + URL
Fi
Else
// The URL is absolute on the current domain
// current_domain is everything needed to hit the same 
web server,
so scheme://[[username]:passw...@]domain.com
URL = current_domain + URL
Fi
Else
// URL is already absolute, including the scheme, domain name, 
etc
Fi

* Browser then (usually) fires off a couple of threads to request the
additional URLs, renders the page and executes any scripts it
contains.

The server has absolutely no involvement in resolving referenced URLs
to complete URLs - this is all done by the browser. HTTP is stateless
to the extreme, meaning that each request gets a single resource, even
if they're done through the same connection.

Hope that makes it clearer.

>> For example, if you have a tag like arse and
>> arse.php is in the same directory as index.php you need to change it
>> to arse.
>>
>> Another example... if you have crack
>> where crack.php is in the subdirectory somedir beneath where index.php
>> is you need to change the tag to > href="/somedir/crack.php">crack.
>>
>> You need to apply this to all URLs in your code, including
>> stylesheets, images and javascript references. This should not be a
>> difficult concept to grasp, so maybe I'm not explaining it right. If
>> so please explain what you understand by what I'm saying and I can
>> alter it to be more helpful.
>
> Here's the issue I have with this: normally I build pages on the fly
> with PHP. However, on this particular project, my wife is building the
> pages in Dreamweaver. And, as I mentioned before, while in development,
> the pages reside on an internal server, like this:
>
> http://pokey/example.com
>
> That is, pokey is an internal Debian machine where all our client sites
> reside as backups in the /var/www directory. So as far as pokey is
> concerned, the pages are at:
>
> /var/www/example.com
>
> but we see it as:
>
> http://pokey/example.com
>
> Dreamweaver has a very brain dead way of handling templates, resultant
> pages, and the internal page links. And while my wife is very savvy,
> her Windows-weenie-Dreamweaver way of handling links is to click on a
> button which opens a dialog box, in which she finds the image, and
> clicks "Okay".
>
> This is all fine while the pages are on the development server. (Well,
> not really, since Dreamweaver regularly hacks up image links in
> non-intuitive ways.) But when they get uploaded to the production server

Re: [PHP] Apache odd behavior

2009-02-17 Thread Virgilio Quilario
> I'm submitting a url like this:
>
> http://mysite.com/index.php/alfa/bravo/charlie/delta
>
> The index.php calls has code to decode the url segments
> (alfa/bravo/charlie/delta). It determines that the controller is alfa,
> the method is bravo, and converts charlie and delta to $_GET['charlie']
> = 'delta'. It verifies that the controller and method exist, and calls
> the controller and method.
>
> This works fine. The right controller gets called and the right method,
> and the GET parameter looks like it should. The method sets some
> variables and then calls a render() function to render the page, which
> is in the doc root of the site.
>
> The page does get rendered, but without the stylesheet, and none of the
> graphics show up. Why? Because, according to the logs, Apache appears to
> be looking for the images and everything else in the directory
> index.php/alfa/bravo/charlie/delta, which of course doesn't exist.
>
> No, I don't have an .htaccess file with RewriteEngine on. Apache figures
> out that index.php is the file to look for in the original URL, but
> can't figure out that everything else is relative to that file, not the
> entire URL.
>
> This method is in use in at least one other MVC framework. What am I
> doing wrong?
>

hi Paul,

to make your css and images work, do something like this



and



the slash at the start tells the browser to start looking from the root.

good luck.

Virgil
http://www.jampmark.com

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



Re: [PHP] Apache odd behavior

2009-02-17 Thread Michael A. Peters

Paul M Foster wrote:
> On Mon, Feb 16, 2009 at 08:34:22PM +, Stuart wrote:

>
> FWIW, I've been doing computers since before the CP/M days
> (pre-pre-DOS), so I do know the difference between absolute and relative
> paths.
>
> I'm a little doubtful about the browser specifying things like the URLs
> for links within a HTML page. However, this would explain why there are
> separate entries for image fetches in the Apache logs, occurring after
> the main page has been requested. Do you have some reference for this?
> I'd like to read more about the server-client interaction in depth.

The client requests the web page. The server sends the web page.
After the client gets the web page it then parses the web page and 
requests any inline elements, such as images, style sheets, iframes, 
etc. - which is why you can have images in different servers etc.


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



Re: [PHP] Apache odd behavior

2009-02-16 Thread Paul M Foster
On Mon, Feb 16, 2009 at 08:34:22PM +, Stuart wrote:



> This is your problem, you're not understanding where the paths are
> being resolved. Apache has absolutely no involvement in resolving
> relative paths in your HTML files to absolute URLs. The browser does
> this. All you need to do is use absolute URLs and everything will work
> fine. By absolute, in case you don't know, I mean starting with a /
> and being "from" the document root in the web server.

FWIW, I've been doing computers since before the CP/M days
(pre-pre-DOS), so I do know the difference between absolute and relative
paths.

I'm a little doubtful about the browser specifying things like the URLs
for links within a HTML page. However, this would explain why there are
separate entries for image fetches in the Apache logs, occurring after
the main page has been requested. Do you have some reference for this?
I'd like to read more about the server-client interaction in depth.

> For example, if you have a tag like arse and
> arse.php is in the same directory as index.php you need to change it
> to arse.
> 
> Another example... if you have crack
> where crack.php is in the subdirectory somedir beneath where index.php
> is you need to change the tag to  href="/somedir/crack.php">crack.
> 
> You need to apply this to all URLs in your code, including
> stylesheets, images and javascript references. This should not be a
> difficult concept to grasp, so maybe I'm not explaining it right. If
> so please explain what you understand by what I'm saying and I can
> alter it to be more helpful.

Here's the issue I have with this: normally I build pages on the fly
with PHP. However, on this particular project, my wife is building the
pages in Dreamweaver. And, as I mentioned before, while in development,
the pages reside on an internal server, like this:

http://pokey/example.com

That is, pokey is an internal Debian machine where all our client sites
reside as backups in the /var/www directory. So as far as pokey is
concerned, the pages are at:

/var/www/example.com

but we see it as:

http://pokey/example.com

Dreamweaver has a very brain dead way of handling templates, resultant
pages, and the internal page links. And while my wife is very savvy,
her Windows-weenie-Dreamweaver way of handling links is to click on a
button which opens a dialog box, in which she finds the image, and
clicks "Okay".

This is all fine while the pages are on the development server. (Well,
not really, since Dreamweaver regularly hacks up image links in
non-intuitive ways.) But when they get uploaded to the production server
on the internet, all those absolute links have to change from:

http://pokey/example.com/graphics/myportrait.gif

or

/example.com/graphics/myportrait.gif

to

http://example.com/graphics/myportrait.gif

or

/graphics/myportrait.gif

Moreover, I'm not even sure she can specify the links absolutely when
doing her "Click and Search" routine. She'd probably have to manually
type them in, unless there's some setting in Dreamweaver I don't know
about.

In any case, changing absolute links in development pages to absolute
links in production pages would involve a heap of (dangerous) global
search-and-replace magic.

So specifying absolute links might be a bit much. I'm not happy with the
way DW handles this stuff, but I have to strike a balance between my
vim-handcoding-command-line method and my wife's
click-and-drag-gotta-be-GUI method.

Paul

-- 
Paul M. Foster

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



Re: [PHP] Apache odd behavior

2009-02-16 Thread Paul M Foster
On Mon, Feb 16, 2009 at 08:53:24PM +, Ashley Sheridan wrote:



> I've read through this thread and not noticed anyone mention the 
> tag. This allows you to specify a URL to which relative ones are mapped
> to, which could be just what you're looking for, as I believe all the
> browsers support it (the tag has been around for donkeys years, so I'd
> be surprised if any browsers didn't support it)

You da man!

I've never heard of this tag, but it shows up on my Visibone cheatbook,
and my HTML 4 reference. Moreover, it works. When the URL in the base
tag is specified as:

http://mysite.com/";>

and, for example, a graphic link is done this way:



It appears to override other considerations with regard to pathing.

I've already chosen an alternative solution, but I'll definitely keep
this in mind for future reference. Thanks, much.

Paul

-- 
Paul M. Foster

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



Re: [PHP] Apache odd behavior

2009-02-16 Thread Stuart
2009/2/16 Ashley Sheridan :
> On Mon, 2009-02-16 at 20:34 +, Stuart wrote:
>> 2009/2/16 Paul M Foster :
>> > On Mon, Feb 16, 2009 at 07:30:57PM +0200, Thodoris wrote:
>> >
>> >>
>> >>> I'm submitting a url like this:
>> >>>
>> >>> http://mysite.com/index.php/alfa/bravo/charlie/delta
>> >>>
>> >>> The index.php calls has code to decode the url segments
>> >>> (alfa/bravo/charlie/delta). It determines that the controller is alfa,
>> >>> the method is bravo, and converts charlie and delta to $_GET['charlie']
>> >>> = 'delta'. It verifies that the controller and method exist, and calls
>> >>> the controller and method.
>> >>>
>> >>> This works fine. The right controller gets called and the right method,
>> >>> and the GET parameter looks like it should. The method sets some
>> >>> variables and then calls a render() function to render the page, which
>> >>> is in the doc root of the site.
>> >>>
>> >>> The page does get rendered, but without the stylesheet, and none of the
>> >>> graphics show up. Why? Because, according to the logs, Apache appears to
>> >>> be looking for the images and everything else in the directory
>> >>> index.php/alfa/bravo/charlie/delta, which of course doesn't exist.
>> >>>
>> >>> No, I don't have an .htaccess file with RewriteEngine on. Apache figures
>> >>> out that index.php is the file to look for in the original URL, but
>> >>> can't figure out that everything else is relative to that file, not the
>> >>> entire URL.
>> >>>
>> >>> This method is in use in at least one other MVC framework. What am I
>> >>> doing wrong?
>> >>>
>> >>> Paul
>> >>>
>> >>>
>> >>
>> >> I assume that in order for this to work you will have to use mod_rewrite
>> >> for apache to work properly. Check the framework's installation
>> >> instructions to see if you configured mod_rewrite correctly for this to
>> >> work properly.
>> >
>> > mod_rewrite isn't involved. Apache has a "lookback" feature that "looks
>> > back" through the URL until it finds an actual file it can execute,
>> > which in this case is index.php. Unfortunately, it appears that Apache
>> > believes the directory in which linked files are found is the *whole*
>> > URL.
>> >
>> > mod_rewrite might resolve this, but it isn't allowed on all servers. So
>> > it's not a reliable solution.
>>
>> This is your problem, you're not understanding where the paths are
>> being resolved. Apache has absolutely no involvement in resolving
>> relative paths in your HTML files to absolute URLs. The browser does
>> this. All you need to do is use absolute URLs and everything will work
>> fine. By absolute, in case you don't know, I mean starting with a /
>> and being "from" the document root in the web server.
>>
>> For example, if you have a tag like arse and
>> arse.php is in the same directory as index.php you need to change it
>> to arse.
>>
>> Another example... if you have crack
>> where crack.php is in the subdirectory somedir beneath where index.php
>> is you need to change the tag to > href="/somedir/crack.php">crack.
>>
>> You need to apply this to all URLs in your code, including
>> stylesheets, images and javascript references. This should not be a
>> difficult concept to grasp, so maybe I'm not explaining it right. If
>> so please explain what you understand by what I'm saying and I can
>> alter it to be more helpful.
>>
>> -Stuart
>>
>> --
>> http://stut.net/
>>
> I've read through this thread and not noticed anyone mention the 
> tag. This allows you to specify a URL to which relative ones are mapped
> to, which could be just what you're looking for, as I believe all the
> browsers support it (the tag has been around for donkeys years, so I'd
> be surprised if any browsers didn't support it)

That should also work, yes. Personally I'd use absolute URLs but each
to their own.

-Stuart

-- 
http://stut.net/

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



Re: [PHP] Apache odd behavior

2009-02-16 Thread Ashley Sheridan
On Mon, 2009-02-16 at 20:34 +, Stuart wrote:
> 2009/2/16 Paul M Foster :
> > On Mon, Feb 16, 2009 at 07:30:57PM +0200, Thodoris wrote:
> >
> >>
> >>> I'm submitting a url like this:
> >>>
> >>> http://mysite.com/index.php/alfa/bravo/charlie/delta
> >>>
> >>> The index.php calls has code to decode the url segments
> >>> (alfa/bravo/charlie/delta). It determines that the controller is alfa,
> >>> the method is bravo, and converts charlie and delta to $_GET['charlie']
> >>> = 'delta'. It verifies that the controller and method exist, and calls
> >>> the controller and method.
> >>>
> >>> This works fine. The right controller gets called and the right method,
> >>> and the GET parameter looks like it should. The method sets some
> >>> variables and then calls a render() function to render the page, which
> >>> is in the doc root of the site.
> >>>
> >>> The page does get rendered, but without the stylesheet, and none of the
> >>> graphics show up. Why? Because, according to the logs, Apache appears to
> >>> be looking for the images and everything else in the directory
> >>> index.php/alfa/bravo/charlie/delta, which of course doesn't exist.
> >>>
> >>> No, I don't have an .htaccess file with RewriteEngine on. Apache figures
> >>> out that index.php is the file to look for in the original URL, but
> >>> can't figure out that everything else is relative to that file, not the
> >>> entire URL.
> >>>
> >>> This method is in use in at least one other MVC framework. What am I
> >>> doing wrong?
> >>>
> >>> Paul
> >>>
> >>>
> >>
> >> I assume that in order for this to work you will have to use mod_rewrite
> >> for apache to work properly. Check the framework's installation
> >> instructions to see if you configured mod_rewrite correctly for this to
> >> work properly.
> >
> > mod_rewrite isn't involved. Apache has a "lookback" feature that "looks
> > back" through the URL until it finds an actual file it can execute,
> > which in this case is index.php. Unfortunately, it appears that Apache
> > believes the directory in which linked files are found is the *whole*
> > URL.
> >
> > mod_rewrite might resolve this, but it isn't allowed on all servers. So
> > it's not a reliable solution.
> 
> This is your problem, you're not understanding where the paths are
> being resolved. Apache has absolutely no involvement in resolving
> relative paths in your HTML files to absolute URLs. The browser does
> this. All you need to do is use absolute URLs and everything will work
> fine. By absolute, in case you don't know, I mean starting with a /
> and being "from" the document root in the web server.
> 
> For example, if you have a tag like arse and
> arse.php is in the same directory as index.php you need to change it
> to arse.
> 
> Another example... if you have crack
> where crack.php is in the subdirectory somedir beneath where index.php
> is you need to change the tag to  href="/somedir/crack.php">crack.
> 
> You need to apply this to all URLs in your code, including
> stylesheets, images and javascript references. This should not be a
> difficult concept to grasp, so maybe I'm not explaining it right. If
> so please explain what you understand by what I'm saying and I can
> alter it to be more helpful.
> 
> -Stuart
> 
> -- 
> http://stut.net/
> 
I've read through this thread and not noticed anyone mention the 
tag. This allows you to specify a URL to which relative ones are mapped
to, which could be just what you're looking for, as I believe all the
browsers support it (the tag has been around for donkeys years, so I'd
be surprised if any browsers didn't support it)


Ash
www.ashleysheridan.co.uk


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



Re: [PHP] Apache odd behavior

2009-02-16 Thread Stuart
2009/2/16 Paul M Foster :
> On Mon, Feb 16, 2009 at 07:30:57PM +0200, Thodoris wrote:
>
>>
>>> I'm submitting a url like this:
>>>
>>> http://mysite.com/index.php/alfa/bravo/charlie/delta
>>>
>>> The index.php calls has code to decode the url segments
>>> (alfa/bravo/charlie/delta). It determines that the controller is alfa,
>>> the method is bravo, and converts charlie and delta to $_GET['charlie']
>>> = 'delta'. It verifies that the controller and method exist, and calls
>>> the controller and method.
>>>
>>> This works fine. The right controller gets called and the right method,
>>> and the GET parameter looks like it should. The method sets some
>>> variables and then calls a render() function to render the page, which
>>> is in the doc root of the site.
>>>
>>> The page does get rendered, but without the stylesheet, and none of the
>>> graphics show up. Why? Because, according to the logs, Apache appears to
>>> be looking for the images and everything else in the directory
>>> index.php/alfa/bravo/charlie/delta, which of course doesn't exist.
>>>
>>> No, I don't have an .htaccess file with RewriteEngine on. Apache figures
>>> out that index.php is the file to look for in the original URL, but
>>> can't figure out that everything else is relative to that file, not the
>>> entire URL.
>>>
>>> This method is in use in at least one other MVC framework. What am I
>>> doing wrong?
>>>
>>> Paul
>>>
>>>
>>
>> I assume that in order for this to work you will have to use mod_rewrite
>> for apache to work properly. Check the framework's installation
>> instructions to see if you configured mod_rewrite correctly for this to
>> work properly.
>
> mod_rewrite isn't involved. Apache has a "lookback" feature that "looks
> back" through the URL until it finds an actual file it can execute,
> which in this case is index.php. Unfortunately, it appears that Apache
> believes the directory in which linked files are found is the *whole*
> URL.
>
> mod_rewrite might resolve this, but it isn't allowed on all servers. So
> it's not a reliable solution.

This is your problem, you're not understanding where the paths are
being resolved. Apache has absolutely no involvement in resolving
relative paths in your HTML files to absolute URLs. The browser does
this. All you need to do is use absolute URLs and everything will work
fine. By absolute, in case you don't know, I mean starting with a /
and being "from" the document root in the web server.

For example, if you have a tag like arse and
arse.php is in the same directory as index.php you need to change it
to arse.

Another example... if you have crack
where crack.php is in the subdirectory somedir beneath where index.php
is you need to change the tag to crack.

You need to apply this to all URLs in your code, including
stylesheets, images and javascript references. This should not be a
difficult concept to grasp, so maybe I'm not explaining it right. If
so please explain what you understand by what I'm saying and I can
alter it to be more helpful.

-Stuart

-- 
http://stut.net/

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



Re: [PHP] Apache odd behavior

2009-02-16 Thread Paul M Foster
On Mon, Feb 16, 2009 at 07:30:57PM +0200, Thodoris wrote:

>
>> I'm submitting a url like this:
>>
>> http://mysite.com/index.php/alfa/bravo/charlie/delta
>>
>> The index.php calls has code to decode the url segments
>> (alfa/bravo/charlie/delta). It determines that the controller is alfa,
>> the method is bravo, and converts charlie and delta to $_GET['charlie']
>> = 'delta'. It verifies that the controller and method exist, and calls
>> the controller and method.
>>
>> This works fine. The right controller gets called and the right method,
>> and the GET parameter looks like it should. The method sets some
>> variables and then calls a render() function to render the page, which
>> is in the doc root of the site.
>>
>> The page does get rendered, but without the stylesheet, and none of the
>> graphics show up. Why? Because, according to the logs, Apache appears to
>> be looking for the images and everything else in the directory
>> index.php/alfa/bravo/charlie/delta, which of course doesn't exist.
>>
>> No, I don't have an .htaccess file with RewriteEngine on. Apache figures
>> out that index.php is the file to look for in the original URL, but
>> can't figure out that everything else is relative to that file, not the
>> entire URL.
>>
>> This method is in use in at least one other MVC framework. What am I
>> doing wrong?
>>
>> Paul
>>
>>
>
> I assume that in order for this to work you will have to use mod_rewrite
> for apache to work properly. Check the framework's installation
> instructions to see if you configured mod_rewrite correctly for this to
> work properly.

mod_rewrite isn't involved. Apache has a "lookback" feature that "looks
back" through the URL until it finds an actual file it can execute,
which in this case is index.php. Unfortunately, it appears that Apache
believes the directory in which linked files are found is the *whole*
URL.

mod_rewrite might resolve this, but it isn't allowed on all servers. So
it's not a reliable solution.

Paul
-- 
Paul M. Foster

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



Re: [PHP] Apache odd behavior

2009-02-16 Thread Thodoris



I'm submitting a url like this:

http://mysite.com/index.php/alfa/bravo/charlie/delta

The index.php calls has code to decode the url segments
(alfa/bravo/charlie/delta). It determines that the controller is alfa,
the method is bravo, and converts charlie and delta to $_GET['charlie']
= 'delta'. It verifies that the controller and method exist, and calls
the controller and method.

This works fine. The right controller gets called and the right method,
and the GET parameter looks like it should. The method sets some
variables and then calls a render() function to render the page, which
is in the doc root of the site.

The page does get rendered, but without the stylesheet, and none of the
graphics show up. Why? Because, according to the logs, Apache appears to
be looking for the images and everything else in the directory
index.php/alfa/bravo/charlie/delta, which of course doesn't exist.

No, I don't have an .htaccess file with RewriteEngine on. Apache figures
out that index.php is the file to look for in the original URL, but
can't figure out that everything else is relative to that file, not the
entire URL.

This method is in use in at least one other MVC framework. What am I
doing wrong?

Paul

  


I assume that in order for this to work you will have to use mod_rewrite 
for apache to work properly. Check the framework's installation 
instructions to see if you configured mod_rewrite correctly for this to 
work properly.


--
Thodoris


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



Re: [PHP] Apache odd behavior

2009-02-16 Thread German Geek
Symfony uses exactly this method for pretty urls. Check it out. Maybe it has
everything you want :). Have a look at symfony's .htaccess rewrite rules at
least. You have a few possibilities here: You can make ur own rewrite for
urls that contain index.php or rewrite
http://mysite.com/alfa/bravo/charlie/deltaas
http://mysite.com/index.php/alfa/bravo/charlie/delta and other urls...

Or in your framework or cms or whatever have helper functions to get the
right urls for images etc. Paths like simply putting  shouldnt be too hard either.

Tim-Hinnerk Heuer

http://www.ihostnz.com
Mike Ditka  - "If God had wanted man to play soccer, he wouldn't have given
us arms."

2009/2/16 Michael A. Peters 

> Paul M Foster wrote:
> > I'm submitting a url like this:
> >
> > http://mysite.com/index.php/alfa/bravo/charlie/delta
>
> Why would you want to do such a thing?
> If you want parameters in the filename without using get, use mod_rewrite
> and explode the page name - and use a delimiter or than a / - IE use an
> underscore, dash, upper case vs lower, etc to indicate your different
> variables.
>
> / has a special meaning in a URL string, I don't understand the motive of
> wanting to use it as a delimiter in a filename. That calls all kinds of
> weird issues (like the one you are experiencing, which is because the
> browser has no way to know index.php is a page - and the browser resolves
> relative URL's - that's not an apache issue)
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


  1   2   3   4   5   6   7   8   9   10   >