php-general Digest 13 Aug 2012 07:01:20 -0000 Issue 7919

2012-08-13 Thread php-general-digest-help

php-general Digest 13 Aug 2012 07:01:20 - Issue 7919

Topics (messages 318672 through 318678):

Re: PHP session variables
318672 by: Marco Behnke
318674 by: Tedd Sperling

Is PHP unsuitable for HTML5 WebSockets?
318673 by: BRIAN M. FITZPATRICK
318678 by: Jim Lucas

Re: Too many open files
318675 by: Al
318676 by: Matijn Woudt

How to best set per-site PHP session storage under suPHP/WordPress?
318677 by: Philip Amadeo Saeli

Administrivia:

To subscribe to the digest, e-mail:
php-general-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
php-general-digest-unsubscr...@lists.php.net

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


--
---BeginMessage---
Am 09.08.12 23:16, schrieb Jim Lucas:
 On 08/09/2012 01:45 PM, Tedd Sperling wrote:
 On Aug 8, 2012, at 5:41 PM, Jim Ginerjim.gi...@albanyhandball.com 
 wrote:

 On 8/8/2012 11:24 AM, Ansry User 01 wrote:
 I am setting the _SESSION variables in one of my file, but whenever
 I leave the php page session variables are not accessible. Not sure
 what I need to do additionally other then defining _SESSION[].
 Any pointer.

 You must make it a habit to start each script with

 session_start();
You should definitely not make that a habbit!
Why create/open a session and send a cookie everytime script call even
if you won't need it? Why access a hard disk to create/open a session
file even if there is no use for it?

Only call session_start() if you need it and call session_write_close()
as early as possible to avoid write locks on the users session file.

And up from PHP 5.4 you can use

http://de2.php.net/manual/de/function.session-status.php

to check a session status.

-- 
Marco Behnke
Dipl. Informatiker (FH), SAE Audio Engineer Diploma
Zend Certified Engineer PHP 5.3

Tel.: 0174 / 9722336
e-Mail: ma...@behnke.biz

Softwaretechnik Behnke
Heinrich-Heine-Str. 7D
21218 Seevetal

http://www.behnke.biz




signature.asc
Description: OpenPGP digital signature
---End Message---
---BeginMessage---
On Aug 10, 2012, at 1:21 PM, Ege Sertçetin sertce...@itu.edu.tr wrote:

 Hi. My question will maybe out of topic, I'm sorry.
 How can you know that one way will be much slower than other one? I mean, how 
 can I learn which function is faster before I test it?

Ege:

No your question is on topic.

This question should be asked on the list, so I'll present Q:A instead of 
answering privately

http://www.webbytedd.com/b/timed1/

The code is there -- if you have questions, please post them to the list.

Cheers,

tedd


_
t...@sperling.com
http://sperling.com
---End Message---
---BeginMessage---
I've looked all over the net and I have been unable to find a concrete answer 
to this question. I am about to start development on a web application that 
will need to provide real-time updates of data to user's browsers. WebSockets 
are ideal for this task.

I have read in some places on the net that PHP is not suitable for WebSockets 
due to it's nature. That WebSockets are designed for long running 
threads/processes which each maintain multiple event-driven connections, 
whereas PHP was designed around the short-lived single process procedural 
paradigm.

Yet on the other hand I see lots of guides and libraries (such as 
http://socketo.me/) on the net that deal with PHP WebSockets. So I don't know 
what to think at this stage. Is PHP a suitable platform for developing a web 
application that requires WebSockets?
---End Message---
---BeginMessage---

On 8/12/2012 12:06 PM, BRIAN M. FITZPATRICK wrote:

I've looked all over the net and I have been unable to find a concrete answer 
to this question. I am about to start development on a web application that 
will need to provide real-time updates of data to user's browsers. WebSockets 
are ideal for this task.

I have read in some places on the net that PHP is not suitable for WebSockets 
due to it's nature. That WebSockets are designed for long running 
threads/processes which each maintain multiple event-driven connections, 
whereas PHP was designed around the short-lived single process procedural 
paradigm.

Yet on the other hand I see lots of guides and libraries (such as 
http://socketo.me/) on the net that deal with PHP WebSockets. So I don't know 
what to think at this stage. Is PHP a suitable platform for developing a web 
application that requires WebSockets?




Back in 2007, I wrote a cli php script to run as a socket server for a 
game I was playing at the time.  It has been running on every server 
I've put together since then.  To say that PHP isn't suited to this type 
of service is wrong.


Give it a shot.  Can't hurt to try.

Jim
---End Message---
---BeginMessage---



On 8/10/2012 12:02 PM, Daniel Brown wrote:

On Fri, Aug 10, 2012 at 10:22 AM, Robert Cummings rob...@interjinn.com wrote:

On 12-08-09 08:01 PM, Al wrote:

I 

php-general Digest 13 Aug 2012 19:09:34 -0000 Issue 7920

2012-08-13 Thread php-general-digest-help

php-general Digest 13 Aug 2012 19:09:34 - Issue 7920

Topics (messages 318679 through 318686):

Re: Is PHP unsuitable for HTML5 WebSockets?
318679 by: Matijn Woudt
318680 by: Adam Richardson

Re: How to best set per-site PHP session storage under suPHP/WordPress?
318681 by: Ian

Re: Repeated New Object Requests
318682 by: Robert Cummings

Re: PHP session variables
318683 by: Robert Cummings

Re: Reading class variable value always returns NULL
318684 by: Robert Cummings
318685 by: Volmar Machado

Re: [PHP-WEBMASTER] php error
318686 by: Daniel Brown

Administrivia:

To subscribe to the digest, e-mail:
php-general-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
php-general-digest-unsubscr...@lists.php.net

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


--
---BeginMessage---
On Mon, Aug 13, 2012 at 9:01 AM, Jim Lucas li...@cmsws.com wrote:
 On 8/12/2012 12:06 PM, BRIAN M. FITZPATRICK wrote:

 I've looked all over the net and I have been unable to find a concrete
 answer to this question. I am about to start development on a web
 application that will need to provide real-time updates of data to user's
 browsers. WebSockets are ideal for this task.

 I have read in some places on the net that PHP is not suitable for
 WebSockets due to it's nature. That WebSockets are designed for long running
 threads/processes which each maintain multiple event-driven connections,
 whereas PHP was designed around the short-lived single process procedural
 paradigm.

 Yet on the other hand I see lots of guides and libraries (such as
 http://socketo.me/) on the net that deal with PHP WebSockets. So I don't
 know what to think at this stage. Is PHP a suitable platform for developing
 a web application that requires WebSockets?



 Back in 2007, I wrote a cli php script to run as a socket server for a game
 I was playing at the time.  It has been running on every server I've put
 together since then.  To say that PHP isn't suited to this type of service
 is wrong.

 Give it a shot.  Can't hurt to try.

 Jim


It works fine. There are many socket applications based on PHP. Just
make sure to set the time limit [1] to 0, or your script will halt.

- Matijn

[1] http://www.php.net/set_time_limit
---End Message---
---BeginMessage---
 I have read in some places on the net that PHP is not suitable for WebSockets 
 due to it's nature. That WebSockets are designed for long running 
 threads/processes which each maintain multiple event-driven connections, 
 whereas PHP was designed around the short-lived single process procedural 
 paradigm.

Well, you could certainly run into trouble if you're not careful. For
example, using an Apache module PHP installation would not likely end
nicely :)

 Yet on the other hand I see lots of guides and libraries (such as 
 http://socketo.me/) on the net that deal with PHP WebSockets. So I don't know 
 what to think at this stage. Is PHP a suitable platform for developing a web 
 application that requires WebSockets?

I'm sure you could get get your application running with PHP. That
said, I personally would not use PHP for the web socket implementation
in my stack. I'd probably use Go, node.js or even Erlang for the web
socket server itself (non-blocking IO is baked into these
environments, which is handy for limiting the resources required for
this type of application), but I'd likely use PHP for components that
weren't directly tied to the web sockets (db frontend, etc.)

Obviously, that's just my personal preference, and as you've noted,
people are doing nice things in the web sockets world with PHP, so it
can be done. That said, I suspect I'd have an easier time with one of
the other languages for this particular aspect of an application, as
the resource management should be much easier to manage. I don't think
there's a right tool for the job, but I do believe some language
environments may better facilitate this specific type of development.

Have fun!

Adam

-- 
Nephtali:  A simple, flexible, fast, and security-focused PHP framework
http://nephtaliproject.com
---End Message---
---BeginMessage---
On 13/08/2012 06:01, Philip Amadeo Saeli wrote:
 I'm administering WordPress sites under suPHP on a CentOS LAMP server
 and would like to know how I can set PHP to keep the session files under
 the WP user's dir without having do duplicate the entire php.ini file
 for each WP site while still maintaining adequate security.  The
 problems I'm encountering are that, AFAICT, I have basically two
 choices:
 
  1. Use the suPHP suPHP_ConfigPath to set the path to a
 per-site php.ini file containing a session.save_path
 directive.
 
  2. Put php.ini files with the session.save_path directive
 within the WP dir hier.
 
 The problems with the above two options (I have found no other options
 so far) are that, 

Re: [PHP] Is PHP unsuitable for HTML5 WebSockets?

2012-08-13 Thread Jim Lucas

On 8/12/2012 12:06 PM, BRIAN M. FITZPATRICK wrote:

I've looked all over the net and I have been unable to find a concrete answer 
to this question. I am about to start development on a web application that 
will need to provide real-time updates of data to user's browsers. WebSockets 
are ideal for this task.

I have read in some places on the net that PHP is not suitable for WebSockets 
due to it's nature. That WebSockets are designed for long running 
threads/processes which each maintain multiple event-driven connections, 
whereas PHP was designed around the short-lived single process procedural 
paradigm.

Yet on the other hand I see lots of guides and libraries (such as 
http://socketo.me/) on the net that deal with PHP WebSockets. So I don't know 
what to think at this stage. Is PHP a suitable platform for developing a web 
application that requires WebSockets?




Back in 2007, I wrote a cli php script to run as a socket server for a 
game I was playing at the time.  It has been running on every server 
I've put together since then.  To say that PHP isn't suited to this type 
of service is wrong.


Give it a shot.  Can't hurt to try.

Jim

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



Re: [PHP] Is PHP unsuitable for HTML5 WebSockets?

2012-08-13 Thread Matijn Woudt
On Mon, Aug 13, 2012 at 9:01 AM, Jim Lucas li...@cmsws.com wrote:
 On 8/12/2012 12:06 PM, BRIAN M. FITZPATRICK wrote:

 I've looked all over the net and I have been unable to find a concrete
 answer to this question. I am about to start development on a web
 application that will need to provide real-time updates of data to user's
 browsers. WebSockets are ideal for this task.

 I have read in some places on the net that PHP is not suitable for
 WebSockets due to it's nature. That WebSockets are designed for long running
 threads/processes which each maintain multiple event-driven connections,
 whereas PHP was designed around the short-lived single process procedural
 paradigm.

 Yet on the other hand I see lots of guides and libraries (such as
 http://socketo.me/) on the net that deal with PHP WebSockets. So I don't
 know what to think at this stage. Is PHP a suitable platform for developing
 a web application that requires WebSockets?



 Back in 2007, I wrote a cli php script to run as a socket server for a game
 I was playing at the time.  It has been running on every server I've put
 together since then.  To say that PHP isn't suited to this type of service
 is wrong.

 Give it a shot.  Can't hurt to try.

 Jim


It works fine. There are many socket applications based on PHP. Just
make sure to set the time limit [1] to 0, or your script will halt.

- Matijn

[1] http://www.php.net/set_time_limit

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



Re: [PHP] Is PHP unsuitable for HTML5 WebSockets?

2012-08-13 Thread Adam Richardson
 I have read in some places on the net that PHP is not suitable for WebSockets 
 due to it's nature. That WebSockets are designed for long running 
 threads/processes which each maintain multiple event-driven connections, 
 whereas PHP was designed around the short-lived single process procedural 
 paradigm.

Well, you could certainly run into trouble if you're not careful. For
example, using an Apache module PHP installation would not likely end
nicely :)

 Yet on the other hand I see lots of guides and libraries (such as 
 http://socketo.me/) on the net that deal with PHP WebSockets. So I don't know 
 what to think at this stage. Is PHP a suitable platform for developing a web 
 application that requires WebSockets?

I'm sure you could get get your application running with PHP. That
said, I personally would not use PHP for the web socket implementation
in my stack. I'd probably use Go, node.js or even Erlang for the web
socket server itself (non-blocking IO is baked into these
environments, which is handy for limiting the resources required for
this type of application), but I'd likely use PHP for components that
weren't directly tied to the web sockets (db frontend, etc.)

Obviously, that's just my personal preference, and as you've noted,
people are doing nice things in the web sockets world with PHP, so it
can be done. That said, I suspect I'd have an easier time with one of
the other languages for this particular aspect of an application, as
the resource management should be much easier to manage. I don't think
there's a right tool for the job, but I do believe some language
environments may better facilitate this specific type of development.

Have fun!

Adam

-- 
Nephtali:  A simple, flexible, fast, and security-focused PHP framework
http://nephtaliproject.com

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



[PHP] Re: How to best set per-site PHP session storage under suPHP/WordPress?

2012-08-13 Thread Ian
On 13/08/2012 06:01, Philip Amadeo Saeli wrote:
 I'm administering WordPress sites under suPHP on a CentOS LAMP server
 and would like to know how I can set PHP to keep the session files under
 the WP user's dir without having do duplicate the entire php.ini file
 for each WP site while still maintaining adequate security.  The
 problems I'm encountering are that, AFAICT, I have basically two
 choices:
 
  1. Use the suPHP suPHP_ConfigPath to set the path to a
 per-site php.ini file containing a session.save_path
 directive.
 
  2. Put php.ini files with the session.save_path directive
 within the WP dir hier.
 
 The problems with the above two options (I have found no other options
 so far) are that, for the former, the system php.ini file is not read so
 the per-site php.ini file(s) have to duplicate most if not all of what's
 in the system php.ini file; this is for each WP site (if not a WP Net
 (AKA WPMU) install); and for the latter, -any-and-every- subdir in the
 WP dir hier that has code that may reference the PHP session must have
 its own php.ini file in it.  Either way it becomes a significant
 maintenance problem, especially once there are more than one or two
 such sites.
 
 I have not been able to find much documentation on this, either in the
 PHP site or in the various help forums.  I've searched quite extensively
 and have run some tests of my own using phpinfo.php to see how things
 are set.
 
 I do not desire to open up file permissions to bypass this PHP settings
 issue altogether due to security concerns (though I do wish an answer
 could be so simple).
 
 What's canonical in such a case?  If nothing, are there any other
 alternatives?  My desired solution would be to be able to put one
 php.ini (or equivalent) file per site that would contain the needed
 directive which would be merged with the settings from the system
 php.ini, overriding only the session.save_path, but, AFAICT, PHP does
 not seem to allow this.  Any other ideas?
 
 Thanks!
 
 --Phil
 
 

Hi,

You can add php.ini variables to the Apache Virtual Host section for
each site, for example:


php_admin_value session.save_path /path/to/new/session/folder

[http://php.net/manual/en/configuration.changes.php]


This will override the save path for each site you add it to, but all
other values will be picked up from the system default.


You must make sure the Apache user has write access to the new folder.

Regards

Ian
-- 



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



Re: [PHP] Repeated New Object Requests

2012-08-13 Thread Robert Cummings

On 12-08-10 02:24 PM, Al wrote:


Off the subject a bit. What does PHP do with repeated new classes, e.g.
$mime = new Mail_mime   Are they simply ignored or are additional new instances
created. PHP won't let you duplicate function names.


Hi Al,

New isn't defining a class, it's a request for an instance of a defined 
class. Thus it will create a new instance over and over again for every 
time the new request is made. The equivalent to won't let you duplicate 
function names is won't let you duplicate class names.


Cheers,
Rob.
--
E-Mail Disclaimer: Information contained in this message and any
attached documents is considered confidential and legally protected.
This message is intended solely for the addressee(s). Disclosure,
copying, and distribution are prohibited unless authorized.

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



Re: [PHP] PHP session variables

2012-08-13 Thread Robert Cummings

On 12-08-10 04:42 PM, Tedd Sperling wrote:

On Aug 10, 2012, at 1:21 PM, Ege Sertçetin sertce...@itu.edu.tr wrote:


Hi. My question will maybe out of topic, I'm sorry.
How can you know that one way will be much slower than other one? I mean, how 
can I learn which function is faster before I test it?


Ege:

No your question is on topic.

This question should be asked on the list, so I'll present Q:A instead of 
answering privately

http://www.webbytedd.com/b/timed1/

The code is there -- if you have questions, please post them to the list.


Ted,

Please see the current signature for microtime():

mixed microtime ([ bool $get_as_float = false ] )

The optional paramter was added in PHP 5.0.0. I think it's safe to 
update your habits :)


Cheers,
Rob.
--
E-Mail Disclaimer: Information contained in this message and any
attached documents is considered confidential and legally protected.
This message is intended solely for the addressee(s). Disclosure,
copying, and distribution are prohibited unless authorized.

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



Re: [PHP] Reading class variable value always returns NULL

2012-08-13 Thread Robert Cummings

On 12-08-12 08:32 AM, Reto Kaiser wrote:

Hi,

So I have this strange situation where I assign a classvariable a
value, but when I read the value it is NULL.

The class has one variable declared:
=
class A {
 private $_cookies;
}
=


That is a private instance variable NOT a class variable.

To declare a class variable you would do the following:

?php

class A
{
private static $_cookies;
}

?


In a method of this class I assign this classvariable plus an
undeclared classvariable and a local variable the value 1:
=
$this-_cookies = 1;
$this-_cookies2 = 1;
$cookies3 = 1;
=

When I now read the values of those variables, the classvariables are
NULL while the local variable is 1:
=
$logEntry .= 'cookies: ' . var_export($this-_cookies, true) . PHP_EOL;
$logEntry .= 'cookies2: ' . var_export($this-_cookies2, true) . PHP_EOL;
$logEntry .= 'cookies3: ' . var_export($cookies3, true) . PHP_EOL;
=
cookies: NULL
cookies2: NULL
cookies3: 1
=

But when reading the whole object, the classvariables are 1:
=
$logEntry .= var_export($this, true) . PHP_EOL;
=
A::__set_state(array(
'_cookies' = 1,
'_cookies2' = 1,
))
=


This happens periodically on a busy webserver. It seems that when it
happens, all classvariables cannot be read anymore (return NULL).
After restarting Apache it does not happen anymore, just to happen
again after some minutes.

The system is current Debian Squeeze:
Linux: linux-image-2.6.32-5-amd64
Apache: apache2-mpm-prefork 2.2.16-6+squeeze7
PHP: PHP 5.3.3-7+squeeze13 with Suhosin-Patch (cli) (built: Jun 10
2012 07:31:32)
php -m: 
https://raw.github.com/gist/3331641/2f7e80bd03abfb728b659634d3f4bac0131f4d6a/gistfile1.txt
php -i: 
https://raw.github.com/gist/3331651/bcf6e3654bf391482627505447848de173d0bbab/gistfile1.txt

Does anyone have an idea what could cause this, or how to further debug?


I can't really speak to your specific problem (unless you're using two 
different instances of the class), just thought I'd clear up the 
difference between class variables and instance variables.


Cheers,
Rob.
--
E-Mail Disclaimer: Information contained in this message and any
attached documents is considered confidential and legally protected.
This message is intended solely for the addressee(s). Disclosure,
copying, and distribution are prohibited unless authorized.

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



Re: [PHP] Reading class variable value always returns NULL

2012-08-13 Thread Volmar Machado
It's only a hint, but You start checking if the Object Ids are the same or not.

2012/8/13 Robert Cummings rob...@interjinn.com:
 On 12-08-12 08:32 AM, Reto Kaiser wrote:

 Hi,

 So I have this strange situation where I assign a classvariable a
 value, but when I read the value it is NULL.

 The class has one variable declared:
 =
 class A {
  private $_cookies;
 }
 =


 That is a private instance variable NOT a class variable.

 To declare a class variable you would do the following:

 ?php

 class A
 {
 private static $_cookies;
 }

 ?


 In a method of this class I assign this classvariable plus an
 undeclared classvariable and a local variable the value 1:
 =
 $this-_cookies = 1;
 $this-_cookies2 = 1;
 $cookies3 = 1;
 =

 When I now read the values of those variables, the classvariables are
 NULL while the local variable is 1:
 =
 $logEntry .= 'cookies: ' . var_export($this-_cookies, true) . PHP_EOL;
 $logEntry .= 'cookies2: ' . var_export($this-_cookies2, true) . PHP_EOL;
 $logEntry .= 'cookies3: ' . var_export($cookies3, true) . PHP_EOL;
 =
 cookies: NULL
 cookies2: NULL
 cookies3: 1
 =

 But when reading the whole object, the classvariables are 1:
 =
 $logEntry .= var_export($this, true) . PHP_EOL;
 =
 A::__set_state(array(
 '_cookies' = 1,
 '_cookies2' = 1,
 ))
 =


 This happens periodically on a busy webserver. It seems that when it
 happens, all classvariables cannot be read anymore (return NULL).
 After restarting Apache it does not happen anymore, just to happen
 again after some minutes.

 The system is current Debian Squeeze:
 Linux: linux-image-2.6.32-5-amd64
 Apache: apache2-mpm-prefork 2.2.16-6+squeeze7
 PHP: PHP 5.3.3-7+squeeze13 with Suhosin-Patch (cli) (built: Jun 10
 2012 07:31:32)
 php -m:
 https://raw.github.com/gist/3331641/2f7e80bd03abfb728b659634d3f4bac0131f4d6a/gistfile1.txt
 php -i:
 https://raw.github.com/gist/3331651/bcf6e3654bf391482627505447848de173d0bbab/gistfile1.txt

 Does anyone have an idea what could cause this, or how to further debug?


 I can't really speak to your specific problem (unless you're using two
 different instances of the class), just thought I'd clear up the difference
 between class variables and instance variables.

 Cheers,
 Rob.
 --
 E-Mail Disclaimer: Information contained in this message and any
 attached documents is considered confidential and legally protected.
 This message is intended solely for the addressee(s). Disclosure,
 copying, and distribution are prohibited unless authorized.


 --
 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] Re: [PHP-WEBMASTER] php error

2012-08-13 Thread Daniel Brown
On Mon, Aug 13, 2012 at 2:32 PM, tomas lagro tomas.la...@hotmail.com wrote:

 Hello, my name is tomas, i'm having a problem and i've checked a lot of times 
 the script and it is not that, because in my local xampp server it works 
 correctly, the issue is that i have a form on my webpage and when you submitt 
 it, the post values are not being requested, so the query array has no values 
 and has no result because of this. Is this a php.ini mistake? what can it be 
 because its driving me crazy. Thanks for ypur time

This email belongs on the PHP General mailing list (CC'd), Tomas,
and you should subscribe to that list at
php-general-subscr...@lists.php.net to follow the discussion and get
help with your questions.

-- 
/Daniel P. Brown
Network Infrastructure Manager
http://www.php.net/

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



Re: [PHP] Re: [PHP-WEBMASTER] php error

2012-08-13 Thread As'ad Djamalilleil
can we see the code of the form ?

On Mon, Aug 13, 2012 at 11:09 AM, Daniel Brown danbr...@php.net wrote:

 On Mon, Aug 13, 2012 at 2:32 PM, tomas lagro tomas.la...@hotmail.com
 wrote:
 
  Hello, my name is tomas, i'm having a problem and i've checked a lot of
 times the script and it is not that, because in my local xampp server it
 works correctly, the issue is that i have a form on my webpage and when you
 submitt it, the post values are not being requested, so the query array has
 no values and has no result because of this. Is this a php.ini mistake?
 what can it be because its driving me crazy. Thanks for ypur time

 This email belongs on the PHP General mailing list (CC'd), Tomas,
 and you should subscribe to that list at
 php-general-subscr...@lists.php.net to follow the discussion and get
 help with your questions.

 --
 /Daniel P. Brown
 Network Infrastructure Manager
 http://www.php.net/

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




[PHP] about unlink

2012-08-13 Thread Tolga

hi, i have a very annoying problem with unlink()
i use win7 and wamp server (apache 2.2.22  php 5.4.3)
when i try to use unlink:

SCREAM: Error suppression ignored for
Warning: unlink(aaa/bbb.ccc): Permission denied in 
C:\wamp\www\ddd\index.php on line /34/


neither the folder, nor the files are read-only. i give every user on 
win, all the permissions on folders  files.
i look on google for same error, but nothing useful. some says 'you need 
to give PHP delete permission' but didnt say how. i run wamp with Run as 
Administrator.
by the way, php can write, create 
(copy(),file_put_contents(),move_uploaded_file(),mkdir()) files or 
folders. there is no problem with it and there is no problem with 
deleting (rmdir)  folders too. but there is problem when it comes to the 
deleting files.


i really need some suggestions about how to solve this, its really 
annoying and  i dont want to throw my pc to the wall or punch it on the 
screen.


Re: [PHP] Re: How to best set per-site PHP session storage under suPHP/WordPress?

2012-08-13 Thread Philip Amadeo Saeli
* Ian php_l...@fishnet.co.uk [2012-08-13 09:50:51 +0100]:
 On 13/08/2012 06:01, Philip Amadeo Saeli wrote:
  I'm administering WordPress sites under suPHP on a CentOS LAMP server
  and would like to know how I can set PHP to keep the session files under
  the WP user's dir without having do duplicate the entire php.ini file
  for each WP site while still maintaining adequate security.  The
  problems I'm encountering are that, AFAICT, I have basically two
  choices:
  
   1. Use the suPHP suPHP_ConfigPath to set the path to a
  per-site php.ini file containing a session.save_path
  directive.
  
   2. Put php.ini files with the session.save_path directive
  within the WP dir hier.
  
  The problems with the above two options (I have found no other options
  so far) are that, for the former, the system php.ini file is not read so
  the per-site php.ini file(s) have to duplicate most if not all of what's
  in the system php.ini file; this is for each WP site (if not a WP Net
  (AKA WPMU) install); and for the latter, -any-and-every- subdir in the
  WP dir hier that has code that may reference the PHP session must have
  its own php.ini file in it.  Either way it becomes a significant
  maintenance problem, especially once there are more than one or two
  such sites.
  
  I have not been able to find much documentation on this, either in the
  PHP site or in the various help forums.  I've searched quite extensively
  and have run some tests of my own using phpinfo.php to see how things
  are set.
  
  I do not desire to open up file permissions to bypass this PHP settings
  issue altogether due to security concerns (though I do wish an answer
  could be so simple).
  
  What's canonical in such a case?  If nothing, are there any other
  alternatives?  My desired solution would be to be able to put one
  php.ini (or equivalent) file per site that would contain the needed
  directive which would be merged with the settings from the system
  php.ini, overriding only the session.save_path, but, AFAICT, PHP does
  not seem to allow this.  Any other ideas?
  
  Thanks!
  
  --Phil
 
 Hi,
 
 You can add php.ini variables to the Apache Virtual Host section for
 each site, for example:
 
 
 php_admin_value session.save_path /path/to/new/session/folder
 
 [http://php.net/manual/en/configuration.changes.php]
 
 
 This will override the save path for each site you add it to, but all
 other values will be picked up from the system default.
 
 
 You must make sure the Apache user has write access to the new folder.
 
 Regards
 
 Ian
 -- 

Thanks, Ian, for the suggestion.  I had tried that without success and
had neglected to mention that in my post.

The reason that it doesn't work, AFAICT, is that, since suPHP runs PHP
as CGI and not DSO, the Apache directives are not available to it.

Any other ideas?  I'd especially like to better understand how PHP
handles php.ini files and any rationale behind the way it handles them.

Thanks,

--Phil

-- 
Philip Amadeo Saeli
openSUSE, RHEL, CentOS
psa...@zorodyne.com

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



[PHP] WebCodeSniffer : a web interface for PHP_CodeSniffer

2012-08-13 Thread EasyPHP
Hi
I'm developing the WAMP server EasyPHP (www.easyphp.org) and I'm using
PHP_CodeSniffer since a while. A lot of users of EasyPHP are confused
when it comes to use a program with CLI like PHP_CodeSniffer. Besides,
we always try to promote good practices and coding standards.
So, I've developed a web interface for PHP_CodeSniffer :
WebCodeSniffer (no need to install PEAR nor use CLI). Once copied at
the root of a domain or in a folder, this interface allows you to
navigate through the directories and to select a file to sniff. You
just need to select the standard and click on 'sniff'.
This first release is very basic and more features will be included
soon. Eleven standards are available so far : PHPCS, PEAR, Squiz,
Zend, PSR1, PSR2, Generic, MySource, Joomla, Drupal, CakePHP.
You can find WebCodeSniffer here : www.webcodesniffer.net
Current version : WebCodeSniffer 0.2
Hope this will help you guys
Regards

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