Re: [PHP] PHP internal memory

2009-11-27 Thread Robert Cummings

Daniel Kolbo wrote:

Hello PHP-hipsters,

I am not sure how to phrase these questions so please bare with me.

I am thinking about performance of a single web server running Apache
(non-cluster) with php as a module.

I have a web app that requires the same php objects(classes) for each
http request.

First, I would like to have the web server keep these object/class
definition files (code) permanently in the memory so the php engine does
not have to keep loading and destroying these objects.  Is this
possible?  Maybe the php engine is already smart enough to handle this.
 I imagine the engine is smart enough to not load the same class
definition into memory for the same http request, but I'm not sure if
the engine is smart enough to recognize that a class definition is
already in the memory from a different http request.


PHP maintains a "shared nothing" philosophy:

http://en.wikipedia.org/wiki/Shared-nothing_architecture

This means there are no application variables in PHP. To accomodate 
something of this nature you will need to use a memory cache like APC or 
 whatnot.



Second, furthermore, say two different http requests actually
instantiate identical objects.  Will both of these identical objects
require their own space in the memory, or is the php engine smart enough
to point both objects to the same memory (until something happens to one
of the objects making it different than the other)? If not, i guess this
is where the idea of caching comes in, and i have to be that smart one
to define the unique keys...


You would have two copies.. because PHP doesn't share like this. In 
fact, I do believe shared memory would still require a copy of the 
shared memory since I imagine marshalling the data back and forth 
between shared memory and PHP native datatype would occur.



Third, when one caches php code using something like memcache, what is
actually being cached: the human readable php, the parsed php, the
serialized php (not really sure what this is), the raw cpu/assembly
instructions, etc...?


Usually the compiled bytecode is stored either in memory or on the 
filesystem if memory is lacking (less used caches would get punted to 
the filesystem). This saves the ocmpilation stage at the least which can 
be quite onerous for large libraries. And if everything fits in memory 
then you can really save on time.



Fourth, where does this cached data live - on the server's hard drive or
in the server's memory (assuming we have enough memory)?


One or the other or both. Depends on your settings and the current 
memory needs.



I assume one of the ideas behind the cache is to by-pass the php parser
and instead just regurgitate the pre-chewed food and spit it out to
apache.  Thus, the memcache would only be storing the php output.  Is
this line of reasoning correct?  And ideally it would be best to have
this prechewed code sitting in the memory, but can I control this?


It's a different kind of chache that stores the output... unless you 
meant the output of the parse stage.



Just to be clear, I am familiar with the idea behind setting a unique
key for the cache and all that.  Also, i am not referring to client side
caching.

Well thanks for sticking with me, as I'm trying to learn these concepts.

Any comments, answers, explanations would be most welcomed.


Hope I've been of help.

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



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



[PHP] PHP internal memory

2009-11-27 Thread Daniel Kolbo
Hello PHP-hipsters,

I am not sure how to phrase these questions so please bare with me.

I am thinking about performance of a single web server running Apache
(non-cluster) with php as a module.

I have a web app that requires the same php objects(classes) for each
http request.

First, I would like to have the web server keep these object/class
definition files (code) permanently in the memory so the php engine does
not have to keep loading and destroying these objects.  Is this
possible?  Maybe the php engine is already smart enough to handle this.
 I imagine the engine is smart enough to not load the same class
definition into memory for the same http request, but I'm not sure if
the engine is smart enough to recognize that a class definition is
already in the memory from a different http request.

Second, furthermore, say two different http requests actually
instantiate identical objects.  Will both of these identical objects
require their own space in the memory, or is the php engine smart enough
to point both objects to the same memory (until something happens to one
of the objects making it different than the other)? If not, i guess this
is where the idea of caching comes in, and i have to be that smart one
to define the unique keys...

Third, when one caches php code using something like memcache, what is
actually being cached: the human readable php, the parsed php, the
serialized php (not really sure what this is), the raw cpu/assembly
instructions, etc...?

Fourth, where does this cached data live - on the server's hard drive or
in the server's memory (assuming we have enough memory)?

I assume one of the ideas behind the cache is to by-pass the php parser
and instead just regurgitate the pre-chewed food and spit it out to
apache.  Thus, the memcache would only be storing the php output.  Is
this line of reasoning correct?  And ideally it would be best to have
this prechewed code sitting in the memory, but can I control this?

Just to be clear, I am familiar with the idea behind setting a unique
key for the cache and all that.  Also, i am not referring to client side
caching.

Well thanks for sticking with me, as I'm trying to learn these concepts.

Any comments, answers, explanations would be most welcomed.

Thanks,
DanK
`

-- 
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] Re: Return object to client

2009-11-27 Thread Robert Cummings

Tony Marston wrote:
It is not possible to return an object via a web service, only data. You can 
create an object in the client process, then populate it with data obtained 
from a web service.


You can serialize the object and return that via the web service. On the 
receiving end it can then be unserialized.


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] Re: Return object to client

2009-11-27 Thread Tony Marston
It is not possible to return an object via a web service, only data. You can 
create an object in the client process, then populate it with data obtained 
from a web service.

-- 
Tony Marston
http://www.tonymarston.net
http://www.radicore.org


"Manoj Singh"  wrote in message 
news:3859a530911260441i1c08dd1agd6826748baa84...@mail.gmail.com...
> Hi All,
>
> I am implementing the web service through PHP SOAP library.
>
> Actually I want to return the object to the client through web service so
> that client can call all the methods of that object.
>
> Please help me out.
>
> Regards,
> Manoj
> 



-- 
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 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] connection to SSL enabled ldap problem

2009-11-27 Thread Tanveer Chowdhury
Hi all
I am having a problem in connection to an SSL enabled ldap server.
In localhost is easily connects to the ldap server with SSL but if try to
connect remotely then it cannot bind to ldap server but can connect.

In the slapd.conf I added the 3 lines to enable SSL
TLSCACertificateFile /usr/local/openssl/misc/demoCA/cacert.pem
TLSCertificateFile /usr/local/openssl/misc/server-cert.pem
TLSCertificateKeyFile /usr/local/openssl/misc/server-key.pem

and then restarted the ldap which is also working in 636 port.

Currently its working in default port without SSL but whenever use the ssl
then it gives the message :
"Could not bind to ldap database"

I have installed the rpms and in phpinfo there is a --with-ssl option too.
Though I have generated the CA and server certificates with compiled
openssl.

Here is ldapconnect code;


Any idea.