php-general Digest 16 May 2013 21:28:59 -0000 Issue 8232

Topics (messages 321082 through 321092):

Re: Saving session to database
        321082 by: Matijn Woudt
        321084 by: Lester Caine

Re: php extension about php_stream_fopen_tmpfile()
        321083 by: Matijn Woudt

Trying to understand what I've broken to not allow mkdir() to work.
        321085 by: Richard Quadling
        321086 by: Alain Williams
        321087 by: Karim Geiger
        321091 by: Richard Quadling

A Good OOP Tutorial/Read?
        321088 by: Dan Joseph
        321089 by: Francisco C Soares
        321090 by: Dan Joseph
        321092 by: Tedd Sperling

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


----------------------------------------------------------------------
--- Begin Message ---
On Thu, May 16, 2013 at 10:43 AM, Lester Caine <les...@lsces.co.uk> wrote:

> I'm having a problem with webtrees ... http://webtrees.net/
> My copy is running on http://webtrees.lsces.org.uk and you will see that
> it is throwing an error relating to the session handling.
>
> Running Apache 2.2.22, PHP5.4.14, MySQL 5.5.31 (
> http://lsces.org.uk/phpinfo.**php <http://lsces.org.uk/phpinfo.php> )
>
> If I comment out the session_set_save_handler() section of session.php
> then I can log in and use the site. Have tried reworking that as a
> SessionHandlerInterface without any success. As far as I can see, the
> 'write' function of the handler is not being called and while there are
> various notes about problems with PHP5.4 blocking access to the write and
> close functions, none of the fixes I have tried have resulted in a working
> setup.
>
> Anybody seen this problem with PHP5.4?
>
> http://lsces.org.uk/hg/**webtrees/file/dcf6ff358108/**
> includes/session.php#l334<http://lsces.org.uk/hg/webtrees/file/dcf6ff358108/includes/session.php#l334>is
>  the code that seems to be failing.
>
>
What error do you get? I tried loading the site but it shows up fine.
In general, you should post the error message in your email anyway, for two
reasons:
1) Most people on this list don't bother to open a (terrible slow) website.
2) Archives, so if anyone after you comes up with the same problem, he will
be able to refer to the archives to find his solution.

- Matijn

--- End Message ---
--- Begin Message ---
Matijn Woudt wrote:



On Thu, May 16, 2013 at 10:43 AM, Lester Caine <les...@lsces.co.uk
<mailto:les...@lsces.co.uk>> wrote:

    I'm having a problem with webtrees ... http://webtrees.net/
    My copy is running on http://webtrees.lsces.org.uk and you will see that it
    is throwing an error relating to the session handling.

    Running Apache 2.2.22, PHP5.4.14, MySQL 5.5.31 (
    http://lsces.org.uk/phpinfo.__php <http://lsces.org.uk/phpinfo.php> )

    If I comment out the session_set_save_handler() section of session.php then
    I can log in and use the site. Have tried reworking that as a
    SessionHandlerInterface without any success. As far as I can see, the
    'write' function of the handler is not being called and while there are
    various notes about problems with PHP5.4 blocking access to the write and
    close functions, none of the fixes I have tried have resulted in a working
    setup.

    Anybody seen this problem with PHP5.4?

    
http://lsces.org.uk/hg/__webtrees/file/dcf6ff358108/__includes/session.php#l334
    
<http://lsces.org.uk/hg/webtrees/file/dcf6ff358108/includes/session.php#l334> is
    the code that seems to be failing.


What error do you get? I tried loading the site but it shows up fine.
In general, you should post the error message in your email anyway, for two 
reasons:
1) Most people on this list don't bother to open a (terrible slow) website.
2) Archives, so if anyone after you comes up with the same problem, he will be
able to refer to the archives to find his solution.

Been working on this most of the morning without success :(
Faulty version is back up, and showing all the error messages, but basically ...

ERROR 2: session_regenerate_id(): Session object destruction failed
0 Error occurred on in function session_regenerate_id
But I think it's the initial session write that is failing

ERROR 2: session_write_close(): Failed to write session data (user). Please verify that the current setting of session.save_path is correct (/var/lib/php5)
0 Error occurred on in function session_write_close

But it should be writing to the database not the file directory.

--
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
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk

--- End Message ---
--- Begin Message ---
On Fri, May 10, 2013 at 3:37 AM, Bleakwind <bleakw...@gmail.com> wrote:

> I write a php extension.
> How can I user Zend API do that?
> where can I find some doc about file_handle->handle ?
>


There's not really a place to ask questions for writing extensions, but
most people here will not be able to answer your question, because they
only write PHP code.
The documentation for the Zend API is freely available from their website.
If it is not there, have a look at the source code, the best documentation
around for any product.
If you still have problems with an extension, the best place to ask would
be the PHP internals list, where the PHP devs hang around, but it does
probably require more understanding from your side first.



>
> ZEND_API zend_op_array *(*org_compile_file)(zend_file_handle *file_handle,
> int type TSRMLS_DC);
> ZEND_API zend_op_array *sead_compile_file(zend_file_handle *file_handle,
> int type TSRMLS_DC)
> {
>     php_stream *stream;
>     char *data_decode;
>     int data_decode_len;
>

Neither php_stream_write nor fwrite use the int type, use size_t instead.


>
>     /* ... */
>
>     /* Zend API Begin: This unsuccessful */
>     php_stream *tmpstream;
>     if ((tmpstream = php_stream_fopen_tmpfile()) == NULL) {
>         php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to create
> temporary file.  Check permissions in temporary files directory.");
>         php_stream_close(stream);
>         return org_compile_file(file_handle, type TSRMLS_CC);
>     }
>     numbytes = php_stream_write(tmpstream, data_decode, data_decode_len);
>     if (numbytes != data_decode_len) {
>         php_error_docref(NULL TSRMLS_CC, E_WARNING, "Only %d of %d bytes
> written, possibly out of free disk space", numbytes, data_decode_len);
>         numbytes = -1;
>     }
>     php_stream_rewind(tmpstream);
>     /* Zend API End */
>
>     /* C Begin: This is OK */
>     FILE *tmpstream;
>     tmpstream = tmpfile();
>     fwrite(data_decode, data_decode_len, 1, tmpstream);
>     rewind(tmpstream);
>     /* C End */
>
>
So what happens? You haven't shown us any error, crash, etc?

- Matijn

--- End Message ---
--- Begin Message ---
Hi.

I'm running on a Mac with a Centos VM (via VirtualBox).

Was running from from our SVN server.

New repo, now running from GIT.

The checkout is on my local machine (using Netbeans, LESS, etc.)

The VM is running Apache and PHP V5.4.15

During the move, I've got some permissions issues, which I simply don't
understand enough to a) resolve myself, b) know what to ask for to get the
right help in solving the issue.

I've been told that the permissions on my mac via the shared folder through
VirtualBox to the Centos setup is where my problem lies. But I don't know.

Is there anyone who can give me definite help here? I can manually create
the directories, but that's just daft.

Nothing LOOKS any different between the two repos, but I don't know how to
tell beyond comparing ls outputs.

Any help would be good.

-- 
Richard Quadling
Twitter : @RQuadling

--- End Message ---
--- Begin Message ---
On Thu, May 16, 2013 at 03:33:53PM +0100, Richard Quadling wrote:
> Hi.
> 
> I'm running on a Mac with a Centos VM (via VirtualBox).
> 
> Was running from from our SVN server.
> 
> New repo, now running from GIT.
> 
> The checkout is on my local machine (using Netbeans, LESS, etc.)
> 
> The VM is running Apache and PHP V5.4.15
> 
> During the move, I've got some permissions issues, which I simply don't
> understand enough to a) resolve myself, b) know what to ask for to get the
> right help in solving the issue.
> 
> I've been told that the permissions on my mac via the shared folder through
> VirtualBox to the Centos setup is where my problem lies. But I don't know.
> 
> Is there anyone who can give me definite help here? I can manually create
> the directories, but that's just daft.
> 
> Nothing LOOKS any different between the two repos, but I don't know how to
> tell beyond comparing ls outputs.
> 
> Any help would be good.

Have you got SELinux switched on ? Try:

    ls -lZ

    getenforce

-- 
Alain Williams
Linux/GNU Consultant - Mail systems, Web sites, Networking, Programmer, IT 
Lecturer.
+44 (0) 787 668 0256  http://www.phcomp.co.uk/
Parliament Hill Computers Ltd. Registration Information: 
http://www.phcomp.co.uk/contact.php
#include <std_disclaimer.h>

--- End Message ---
--- Begin Message ---
Hi Richard,

On 05/16/2013 04:33 PM, Richard Quadling wrote:
> Hi.
> 
> I'm running on a Mac with a Centos VM (via VirtualBox).
> 
> Was running from from our SVN server.
> 
> New repo, now running from GIT.
> 
> The checkout is on my local machine (using Netbeans, LESS, etc.)
> 
> The VM is running Apache and PHP V5.4.15
> 
> During the move, I've got some permissions issues, which I simply don't
> understand enough to a) resolve myself, b) know what to ask for to get the
> right help in solving the issue.
> 
> I've been told that the permissions on my mac via the shared folder through
> VirtualBox to the Centos setup is where my problem lies. But I don't know.
> 
> Is there anyone who can give me definite help here? I can manually create
> the directories, but that's just daft.
> 
> Nothing LOOKS any different between the two repos, but I don't know how to
> tell beyond comparing ls outputs.
> 
> Any help would be good.

What happens if you're making an ls -la in your Terminal on your SVN
folder? Could you paste the output? It looks like the owner or
permissions of the folder aren't correct.

Regards

Karim

-- 
Karim Geiger
Auszubildender Fachinformatiker AE

B1 Systems GmbH
Osterfeldstraße 7 / 85088 Vohburg / http://www.b1-systems.de
GF: Ralph Dehner / Unternehmenssitz: Vohburg / AG: Ingolstadt,HRB 3537

Attachment: signature.asc
Description: OpenPGP digital signature


--- End Message ---
--- Begin Message ---
On 16 May 2013 15:42, Karim Geiger <gei...@b1-systems.de> wrote:

> Hi Richard,
>
> On 05/16/2013 04:33 PM, Richard Quadling wrote:
> > Hi.
> >
> > I'm running on a Mac with a Centos VM (via VirtualBox).
> >
> > Was running from from our SVN server.
> >
> > New repo, now running from GIT.
> >
> > The checkout is on my local machine (using Netbeans, LESS, etc.)
> >
> > The VM is running Apache and PHP V5.4.15
> >
> > During the move, I've got some permissions issues, which I simply don't
> > understand enough to a) resolve myself, b) know what to ask for to get
> the
> > right help in solving the issue.
> >
> > I've been told that the permissions on my mac via the shared folder
> through
> > VirtualBox to the Centos setup is where my problem lies. But I don't
> know.
> >
> > Is there anyone who can give me definite help here? I can manually create
> > the directories, but that's just daft.
> >
> > Nothing LOOKS any different between the two repos, but I don't know how
> to
> > tell beyond comparing ls outputs.
> >
> > Any help would be good.
>
> What happens if you're making an ls -la in your Terminal on your SVN
> folder? Could you paste the output? It looks like the owner or
> permissions of the folder aren't correct.
>
> Regards
>
> Karim
>
> --
> Karim Geiger
> Auszubildender Fachinformatiker AE
>
> B1 Systems GmbH
> Osterfeldstraße 7 / 85088 Vohburg / http://www.b1-systems.de
> GF: Ralph Dehner / Unternehmenssitz: Vohburg / AG: Ingolstadt,HRB 3537
>
>
Seems the mounting is the issue.

mount -o nosuid,uid=apache,gid=apache -t vboxsf ccdev /mnt/newbuild

And that has mounted the drive and the mkdir() is working!

And in further looking, my /etc/fstab was trying to mount ccdev to
/mnt/trunk ...

ARGH!!!

Sorry for the noise. I need a beer now!

-- 
Richard Quadling
Twitter : @RQuadling
EE : http://e-e.com/M_248814.html
Zend : http://bit.ly/9O8vFY

--- End Message ---
--- Begin Message ---
Hey Folks,

I'm looking to refine my PHP 5 OOP skills.  I know the basics, understand
patterns, but have clearly missed a few things along the way.

Do any of you have some real good PHP 5 OOP tutorials/reads bookmarked you
could share?  Something other than php.net/oop5.

Thanks!

-- 
-Dan Joseph

http://www.danjoseph.me
http://www.dansrollingbbq.com
http://www.youtube.com/DansRollingBBQ

--- End Message ---
--- Begin Message ---
On 05/16/2013 11:55 AM, Dan Joseph wrote:
Hey Folks,

I'm looking to refine my PHP 5 OOP skills.  I know the basics, understand
patterns, but have clearly missed a few things along the way.

Do any of you have some real good PHP 5 OOP tutorials/reads bookmarked you
could share?  Something other than php.net/oop5.
Try,
Tente,

http://www.killerphp.com/tutorials/object-oriented-php/

Success!
Sucesso!

___________________________
Francisco C Soares ( *Junior* )
403790c898466667cdbe5a262146de8fb93139c4

BLOG dotjunior.blogspot.com <http://dotjunior.blogspot.com/>

--- End Message ---
--- Begin Message ---
Thanks!  This looks like a good start.  Covers some things I have questions
on.  I like his approach.

Now I just need something advanced to continue on after this.  I'd like to
learn more about extending, interfaces, abstracts, and why/when they should
be used.

Appreciate it!

-Dan


On Thu, May 16, 2013 at 11:01 AM, Francisco C Soares <dotjun...@gmail.com>wrote:

>  On 05/16/2013 11:55 AM, Dan Joseph wrote:
>
> Hey Folks,
>
> I'm looking to refine my PHP 5 OOP skills.  I know the basics, understand
> patterns, but have clearly missed a few things along the way.
>
> Do any of you have some real good PHP 5 OOP tutorials/reads bookmarked you
> could share?  Something other than php.net/oop5.
>
>  Try,
> Tente,
>
> http://www.killerphp.com/tutorials/object-oriented-php/
>
> Success!
> Sucesso!
>
> ___________________________
> Francisco C Soares ( *Junior* )
> 403790c898466667cdbe5a262146de8fb93139c4
>
> BLOG dotjunior.blogspot.com
>



-- 
-Dan Joseph

http://www.danjoseph.me
http://www.dansrollingbbq.com
http://www.youtube.com/DansRollingBBQ

--- End Message ---
--- Begin Message ---
-Dan:

I teach this stuff and still don't fully understand the why/when for interfaces.

Even the guru's I talk with can't give me a good explanation as to what the 
advantages are in using them. I've done a lot of experimenting and can't see 
any advantage for them other than grouping different classes together and 
creating a new data-tytpe.

Other than that, from my perspective interfaces are mythicode.
 
So, if you find a good reference, please let me know.

Cheers,

tedd


_____________________
tedd.sperl...@gmail.com
http://sperling.com





On May 16, 2013, at 11:11 AM, Dan Joseph <dmjos...@gmail.com> wrote:

> Thanks!  This looks like a good start.  Covers some things I have questions
> on.  I like his approach.
> 
> Now I just need something advanced to continue on after this.  I'd like to
> learn more about extending, interfaces, abstracts, and why/when they should
> be used.
> 
> Appreciate it!
> 
> -Dan
> 
> 
> On Thu, May 16, 2013 at 11:01 AM, Francisco C Soares 
> <dotjun...@gmail.com>wrote:
> 
>> On 05/16/2013 11:55 AM, Dan Joseph wrote:
>> 
>> Hey Folks,
>> 
>> I'm looking to refine my PHP 5 OOP skills.  I know the basics, understand
>> patterns, but have clearly missed a few things along the way.
>> 
>> Do any of you have some real good PHP 5 OOP tutorials/reads bookmarked you
>> could share?  Something other than php.net/oop5.
>> 
>> Try,
>> Tente,
>> 
>> http://www.killerphp.com/tutorials/object-oriented-php/
>> 
>> Success!
>> Sucesso!
>> 
>> ___________________________
>> Francisco C Soares ( *Junior* )
>> 403790c898466667cdbe5a262146de8fb93139c4
>> 
>> BLOG dotjunior.blogspot.com
>> 
> 
> 
> 
> -- 
> -Dan Joseph
> 
> http://www.danjoseph.me
> http://www.dansrollingbbq.com
> http://www.youtube.com/DansRollingBBQ


--- End Message ---

Reply via email to