php-general Digest 22 Jun 2009 07:26:13 -0000 Issue 6188
Topics (messages 294381 through 294402):
Re: mirroring website
294381 by: Nitsan Bin-Nun
294382 by: Richard Heyes
294383 by: Lars Nielsen
294384 by: Jonesy
Re: isset question
294385 by: Gary
294388 by: Ashley Sheridan
Re: Calendar
294386 by: Ashley Sheridan
Re: PHP Mail Function
294387 by: Ashley Sheridan
share code between sites
294389 by: Lars Nielsen
294390 by: Eddie Drapkin
294391 by: Nathan Nobbe
294392 by: Lars Nielsen
Passing Values between C App and PHP
294393 by: Tobias Krieger
294394 by: Nathan Nobbe
294395 by: Tobias Krieger
294396 by: Nathan Nobbe
294402 by: bruce
Problems with APC, possible cache-corruption?
294397 by: James McLean
294398 by: Nathan Nobbe
294399 by: James McLean
294400 by: Jonathan Tapicer
294401 by: James McLean
Administrivia:
To subscribe to the digest, e-mail:
[email protected]
To unsubscribe from the digest, e-mail:
[email protected]
To post to the list, e-mail:
[email protected]
----------------------------------------------------------------------
--- Begin Message ---
Create 2 different configuration files, load the appropriate one after
checking whether $_ENV['dev'] is set to 1 or 0 then all you have to do is to
set the environment variable 'dev' to 1 or 0 through .htaccess file.
After setting this up all you have to do is to rewrite the files whenever
you want to update the files in the production server or vice versa.
Just my $0.02 ;)
Nitsan
On Sun, Jun 21, 2009 at 4:56 PM, Lars Nielsen <[email protected]> wrote:
> Hey
>
> I have the following issue! I want to develop my website on my local
> machine, and then upload the entire developed site to a production
> server. What is the best strategy to do that?
> I have been looking at a php mirroring script but that was about 5 years
> old! Is'nt there a better/newer approach?
>
> By the way... I'm using Fedora linux with LAMP (php5)
>
> best regards
> Lars Nielsen
> www.mit-web.dk
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
Hi,
> I have the following issue! I want to develop my website on my local
> machine, and then upload the entire developed site to a production
> server. What is the best strategy to do that?
> I have been looking at a php mirroring script but that was about 5 years
> old! Is'nt there a better/newer approach?
I used to use rsync (with a bunch of options) whenever I did this.
With you being on Linux, it would be trivial to automate it with a
script.
--
Richard Heyes
HTML5 graphing: RGraph (www.rgraph.net - updated 20th June)
PHP mail: RMail (www.phpguru.org/rmail)
PHP datagrid: RGrid (www.phpguru.org/rgrid)
PHP Template: RTemplate (www.phpguru.org/rtemplate)
PHP SMTP: http://www.phpguru.org/smtp
--- End Message ---
--- Begin Message ---
Thanks for the cents.
I will try a combination of multiple configuration files and rsync!
/Lars
søn, 21 06 2009 kl. 16:39 +0100, skrev Richard Heyes:
> Hi,
>
> > I have the following issue! I want to develop my website on my local
> > machine, and then upload the entire developed site to a production
> > server. What is the best strategy to do that?
> > I have been looking at a php mirroring script but that was about 5 years
> > old! Is'nt there a better/newer approach?
>
> I used to use rsync (with a bunch of options) whenever I did this.
> With you being on Linux, it would be trivial to automate it with a
> script.
>
> --
> Richard Heyes
> HTML5 graphing: RGraph (www.rgraph.net - updated 20th June)
> PHP mail: RMail (www.phpguru.org/rmail)
> PHP datagrid: RGrid (www.phpguru.org/rgrid)
> PHP Template: RTemplate (www.phpguru.org/rtemplate)
> PHP SMTP: http://www.phpguru.org/smtp
>
--- End Message ---
--- Begin Message ---
On Sun, 21 Jun 2009 16:39:18 +0100, Richard Heyes wrote:
>
>> I have the following issue! I want to develop my website on my local
>> machine, and then upload the entire developed site to a production
>> server. What is the best strategy to do that?
>> I have been looking at a php mirroring script but that was about 5 years
>> old! Is'nt there a better/newer approach?
>
> I used to use rsync (with a bunch of options) whenever I did this.
> With you being on Linux, it would be trivial to automate it with a
> script.
And, if you don't have ssh access to the web server -- but rather, just
ftp -- there's `ftpsync` which I use. When Googling for `ftpsync` ,
ignore the windo$ hits. There's a name collison there. You want the
linux program.
Be carefull with ".htaccess". heh heh Mine are different for the local
machine -- mainly for testing and local lan purposes. Now and then I
screw up and upload an .htaccess from the local web server to the
World-Wide-Web server. Big snafu - that! :-)
HTH
Jonesy
--
Marvin L Jones | jonz | W3DHJ | linux
38.24N 104.55W | @ config.com | Jonesy | OS/2
* Killfiling google & XXXXbanter.com: jonz.net/ng.htm
--- End Message ---
--- Begin Message ---
How does echoing back to the page make it vulnerable? This does not go to a
DB if that makes any difference.
Gary
"Paul M Foster" <[email protected]> wrote in message
news:[email protected]...
> On Sat, Jun 20, 2009 at 12:20:56PM +0100, Ashley Sheridan wrote:
>
>> On Sat, 2009-06-20 at 00:19 -0400, Paul M Foster wrote:
>> > On Fri, Jun 19, 2009 at 07:52:40PM +0100, Ashley Sheridan wrote:
>> >
>> > > On Fri, 2009-06-19 at 12:36 +0100, Ford, Mike wrote:
>> > > > On 18 June 2009 20:25, LAMP advised:
>> > > >
>> > > > > using !empty() instead isset() will work if you don't care for
>> > > > > PHP
>> > > > > Notice: Undefined variable... If you want to avoid PHP Notice
>> > > > > you have
>> > > > > to use both:
>> > > > >
>> > > > > $msg.= (isset($_POST['mort']) and !empty($_POST['mort'])) ? "The
>> > > > > mortgage amount is $mort\n" : " ";
>> > > >
>> > > > Absolute rubbish -- as it says at http://php.net/empty,
>> > > > "empty($var) is
>> > > > the opposite of (boolean)$var, except that no warning is generated
>> > > > when
>> > > > the variable is not set." -- so "protecting" empty() with an
>> > > > isset() is
>> > > > a total waste of time, space and cpu cycles.
>> >
>> > <snip>
>> >
>> > > >
>> > > To be honest, you're still opening yourself up to attack that way.
>> >
>> > Why and how?
>> >
>> > Paul
>> >
>> > --
>> > Paul M. Foster
>> >
>> I've only done a little reading on this, but you're opening yourself up
>> to a XSS attack. If someone posted '<script>//malicious code
>> here</script>' to your PHP script, you'd essentially be printing that
>> right back out onto your page.
>
> I see. You're not talking about being vulnerable because of isset/empty,
> but by echoing it back to the page. Yes, I agree there. You have to
> sanitize it first.
>
> Paul
>
> --
> Paul M. Foster
--- End Message ---
--- Begin Message ---
On Sun, 2009-06-21 at 13:57 -0400, Gary wrote:
> How does echoing back to the page make it vulnerable? This does not go to a
> DB if that makes any difference.
>
> Gary
>
>
> "Paul M Foster" <[email protected]> wrote in message
> news:[email protected]...
> > On Sat, Jun 20, 2009 at 12:20:56PM +0100, Ashley Sheridan wrote:
> >
> >> On Sat, 2009-06-20 at 00:19 -0400, Paul M Foster wrote:
> >> > On Fri, Jun 19, 2009 at 07:52:40PM +0100, Ashley Sheridan wrote:
> >> >
> >> > > On Fri, 2009-06-19 at 12:36 +0100, Ford, Mike wrote:
> >> > > > On 18 June 2009 20:25, LAMP advised:
> >> > > >
> >> > > > > using !empty() instead isset() will work if you don't care for
> >> > > > > PHP
> >> > > > > Notice: Undefined variable... If you want to avoid PHP Notice
> >> > > > > you have
> >> > > > > to use both:
> >> > > > >
> >> > > > > $msg.= (isset($_POST['mort']) and !empty($_POST['mort'])) ? "The
> >> > > > > mortgage amount is $mort\n" : " ";
> >> > > >
> >> > > > Absolute rubbish -- as it says at http://php.net/empty,
> >> > > > "empty($var) is
> >> > > > the opposite of (boolean)$var, except that no warning is generated
> >> > > > when
> >> > > > the variable is not set." -- so "protecting" empty() with an
> >> > > > isset() is
> >> > > > a total waste of time, space and cpu cycles.
> >> >
> >> > <snip>
> >> >
> >> > > >
> >> > > To be honest, you're still opening yourself up to attack that way.
> >> >
> >> > Why and how?
> >> >
> >> > Paul
> >> >
> >> > --
> >> > Paul M. Foster
> >> >
> >> I've only done a little reading on this, but you're opening yourself up
> >> to a XSS attack. If someone posted '<script>//malicious code
> >> here</script>' to your PHP script, you'd essentially be printing that
> >> right back out onto your page.
> >
> > I see. You're not talking about being vulnerable because of isset/empty,
> > but by echoing it back to the page. Yes, I agree there. You have to
> > sanitize it first.
> >
> > Paul
> >
> > --
> > Paul M. Foster
>
>
>
My assumption was that because it was displaying the mortgage amount to
the user, that it would at some point store it too.
Thanks
Ash
www.ashleysheridan.co.uk
--- End Message ---
--- Begin Message ---
On Sat, 2009-06-20 at 10:26 -0400, tedd wrote:
> At 7:58 PM +0100 6/19/09, Ashley Sheridan wrote:
> >On Fri, 2009-06-19 at 15:30 +0530, Sudheer Satyanarayana wrote:
> >> salmarayan wrote:
> >> > Does Any body please have the code of A Java Script Calendar
> >>that works with
> >> > a PHP Html Form..
> >> > if yes can you please send it as i have one but does not work that
> >> > Efficiently.
> >> >
> >> > Thanks in advance
> >> >
> >> This might help if you are looking for a date picker
> >>
> >> http://techchorus.net/add-cool-date-picker-2-lines-javascript
> >>
> >>
> >> --
> >>
> >> With warm regards,
> >> Sudheer. S
> >> Business: http://binaryvibes.co.in, Tech stuff:
> >>http://techchorus.net, Personal: http://sudheer.net
> >>
> >>
> >I've always used Tigra calendar, and it's been very flexible for me for
> >a lot of sites. Don't know whether or not it is still maintained, as I
> >keep using the same source I picked up a couple of years back! If you
> >have trouble finding it, give me a shout.
> >
> >Thanks
> >Ash
>
> Ash et al:
>
> I like to roll and maintain my own. While it's not javascript, it works.
>
> http://webbytedd.com/bbbb/tedd-php-calendar/ <-- code is there
>
> And it's fairly easy to hook up to a database, such as seen here:
>
> http://php1.net/my-php-calendar/
>
> The original code for the db version can be found in the php-calendar
> (http://php-calendar.com).
>
> Cheers,
>
> tedd
>
> --
> -------
> http://sperling.com http://ancientstones.com http://earthstones.com
>
Tedd, as you ought to know by now, I rolled my own of those a while back
too, it's come up on these lists a few times! :p The op just asked for a
calendar that was javascript based for a user to add a data into a form
Thanks
Ash
www.ashleysheridan.co.uk
--- End Message ---
--- Begin Message ---
On Sat, 2009-06-20 at 20:30 -0600, David Swenson wrote:
> Julian,
>
> From my understanding of PHP's mail() function, it doesn't do anything
> more than send to the address you specified.
>
> On that note, I'd check things like:
> Email address typos
> The email your sending to your domain, is it already being forwarded?
> If so, do you get the email at your gmail account?
> If it's not being forwarded, add $additionalheaders to your script and
> CC: your gmail account when sending to your domain. See if it shows up
> there.
>
> Anyway those are somethings you could try as you have supplied no code
> to check syntax and/or given any other testing you've tried.
>
> Good Luck,
> David
>
>
> -----Original Message-----
> From: Julian Muscat Doublesin [mailto:[email protected]]
> Sent: Saturday, June 20, 2009 1:59 PM
> To: [email protected]
> Subject: [PHP] PHP Mail Function
>
>
> Hello Everyone,
>
> I have written an e-mail function that sends e-mail to my domain that
> forwards it to a gmail account.
>
> When I use the gmail address directly it works fine. When I use my mail
> domain i don't get anything.
>
> Has anyone experienced this? Can anyone give me some advice?
>
> Thanks in advance
>
> Julian
> No virus found in this incoming message.
> Checked by AVG - www.avg.com
> Version: 8.5.364 / Virus Database: 270.12.81/2189 - Release Date:
> 06/20/09 06:15:00
>
>
>
I had this problem before, and it seems that spam filters of all
descriptions were the culprit.
Thanks
Ash
www.ashleysheridan.co.uk
--- End Message ---
--- Begin Message ---
Hey List
Is there any good approach to share code between multiple sites? The
code might be on the same server but on different domains.
best regards
Lars
--- End Message ---
--- Begin Message ---
The same document root and different Vhosts?
On Sun, Jun 21, 2009 at 4:01 PM, Lars Nielsen<[email protected]> wrote:
> Hey List
>
> Is there any good approach to share code between multiple sites? The
> code might be on the same server but on different domains.
>
> best regards
>
> Lars
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
On Sun, Jun 21, 2009 at 2:01 PM, Lars Nielsen <[email protected]> wrote:
> Hey List
>
> Is there any good approach to share code between multiple sites? The
> code might be on the same server but on different domains.
put your common code outside the web root, and use the include_path ini
setting in all the various sites to get access to it.
thats one way to do it.
-nathan
--- End Message ---
--- Begin Message ---
Yeah maybe thats the way to do it. It certantly sounds like a working
solution.
søn, 21 06 2009 kl. 16:02 -0400, skrev Eddie Drapkin:
> The same document root and different Vhosts?
>
> On Sun, Jun 21, 2009 at 4:01 PM, Lars Nielsen<[email protected]> wrote:
> > Hey List
> >
> > Is there any good approach to share code between multiple sites? The
> > code might be on the same server but on different domains.
> >
> > best regards
> >
> > Lars
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
--- End Message ---
--- Begin Message ---
Hi,
I've recently written an eMail regarding I2C and PHP - since I haven't
found a nice solution yet, I'm considering writting the I2C part
(opening device, writing, reading,...) in C (that's simple) and to
recieve (and returning) the values through PHP and Javascript.
E.g. Website (PHP/Javascript) -> set a new motorspeed -> PHP passes
the new speed to C Application -> C AP opens and writes the new speed
onto the I2C Bus -> Motor executes -> returns ack ->----
Is this somehow, and not complicated possible?
Thanks,
Tobias
--- End Message ---
--- Begin Message ---
On Sun, Jun 21, 2009 at 3:25 PM, Tobias Krieger <
[email protected]> wrote:
> Hi,
>
> I've recently written an eMail regarding I2C and PHP - since I haven't
> found a nice solution yet, I'm considering writting the I2C part (opening
> device, writing, reading,...) in C (that's simple) and to recieve (and
> returning) the values through PHP and Javascript.
>
> E.g. Website (PHP/Javascript) -> set a new motorspeed -> PHP passes the new
> speed to C Application -> C AP opens and writes the new speed onto the I2C
> Bus -> Motor executes -> returns ack ->----
>
> Is this somehow, and not complicated possible?
if the C program is written such that it can start and stop on every request
rather than as a daemon, its as simple as shell_exec().
write your C app to take args over the cli and then pass them in through the
call:
<?php
$result = shell_exec('myI2C -speed 50');
?>
something of that nature.
-nathan
--- End Message ---
--- Begin Message ---
Am 21.06.2009 um 23:31 schrieb Nathan Nobbe:
On Sun, Jun 21, 2009 at 3:25 PM, Tobias Krieger <[email protected]
> wrote:
Hi,
I've recently written an eMail regarding I2C and PHP - since I
haven't found a nice solution yet, I'm considering writting the I2C
part (opening device, writing, reading,...) in C (that's simple) and
to recieve (and returning) the values through PHP and Javascript.
E.g. Website (PHP/Javascript) -> set a new motorspeed -> PHP passes
the new speed to C Application -> C AP opens and writes the new
speed onto the I2C Bus -> Motor executes -> returns ack ->----
Is this somehow, and not complicated possible?
if the C program is written such that it can start and stop on every
request rather than as a daemon, its as simple as shell_exec().
write your C app to take args over the cli and then pass them in
through the call:
<?php
$result = shell_exec('myI2C -speed 50');
?>
something of that nature.
-nathan
This would be a nice and fast solution, but unfortunatelly, it's like
that the C programm needs to surveilance the hardware all the time
(controlling values,...) hence, it would run more as a "daemon".
thx,
tobias
--- End Message ---
--- Begin Message ---
On Sun, Jun 21, 2009 at 3:44 PM, Tobias Krieger <
[email protected]> wrote:
> This would be a nice and fast solution, but unfortunatelly, it's like that
> the C programm needs to surveilance the hardware all the time (controlling
> values,...) hence, it would run more as a "daemon".
>
then you will have to make the C app accept socket connections; or maybe try
unix signals handlers in the C app w/ shared memory betwen both processes;
maybe there are easier ways to do it..
-nathan
--- End Message ---
--- Begin Message ---
if memory serves...
you can look into using a shared memory block, or pipes to communicate
between the php/c app....
-----Original Message-----
From: Tobias Krieger [mailto:[email protected]]
Sent: Sunday, June 21, 2009 2:44 PM
To: Nathan Nobbe
Cc: [email protected]
Subject: Re: [PHP] Passing Values between C App and PHP
Am 21.06.2009 um 23:31 schrieb Nathan Nobbe:
> On Sun, Jun 21, 2009 at 3:25 PM, Tobias Krieger
<[email protected]
> > wrote:
> Hi,
>
> I've recently written an eMail regarding I2C and PHP - since I
> haven't found a nice solution yet, I'm considering writting the I2C
> part (opening device, writing, reading,...) in C (that's simple) and
> to recieve (and returning) the values through PHP and Javascript.
>
> E.g. Website (PHP/Javascript) -> set a new motorspeed -> PHP passes
> the new speed to C Application -> C AP opens and writes the new
> speed onto the I2C Bus -> Motor executes -> returns ack ->----
>
> Is this somehow, and not complicated possible?
>
> if the C program is written such that it can start and stop on every
> request rather than as a daemon, its as simple as shell_exec().
>
> write your C app to take args over the cli and then pass them in
> through the call:
>
> <?php
> $result = shell_exec('myI2C -speed 50');
> ?>
>
> something of that nature.
>
> -nathan
>
This would be a nice and fast solution, but unfortunatelly, it's like
that the C programm needs to surveilance the hardware all the time
(controlling values,...) hence, it would run more as a "daemon".
thx,
tobias
--- End Message ---
--- Begin Message ---
(Resend from around 1 week ago, because of no responses)
Hi All,
Over the weekend I setup a test of APC intending to benchmark a Moodle
installation with various APC settings to see how well I could get it
to perform. I successfully installed Moodle 1.9 and 2.0 under Apache
2.2.3 (installed via apt on Ubuntu 9.04), and with PHP 5.2.9 compiled
from source. I should note, that Ubuntu had an older version of PHP
installed from apt with Suhosin hardened PHP built in. Moodle 2.0
required at least PHP 5.2.8, so I uninstalled the original PHP module
before compiling and installing the 5.2.9.
No issues there; PHP worked well and performance was (mostly) acceptable.
Progressed onto installing APC, firstly by downloading the APC 3.1.2
source from PECL and following the usual 'phpize, configure, make,
make install' process which worked as expected, stop and start Apache
and APC was present in my phpinfo();. I started with the reccomended
PHP config exept with error_display turned on and E_ALL | E_STRICT
enabled, and also the reccomended APC config also.
I copied the 'apc.php' from the source tree to my webroot and changed
the password as suggested.
The issue arose when I attempted to benchmark my Moodle install with
'ab' (I realise it only downloads the single page, but it's good
enough for what I need for now though) and the result was no different
to before I had installed APC. View the apc.php page, and the only
page cached is apc.php itself.. Certainly not what I've witnessed in
the past. Then what would happen was if I viewed my seperate info.php
page containing simply the opening PHP tag and a single line with
phpinfo(); in the file - the cache would appear to reset, and it would
firstly not load the info.php into the cache, it would reset the
counter on the apc.php file back to 0.
Through all of this, there was no errors displayed on the screen and
no errors listed in the Apache error log either. Increased the Apache
log level up to Debug, and no related information was displayed.
Moodle itself worked as expected with no errors, and on a seperate
RHEL installation I have Moodle working with APC and it is caching all
it's files as expected.
At this point, I thought it may be an issue with the module I compiled
myself. I backed up the module, and allowed PECL to install the
module, it installed 3.0.19. Restarted Apache and verified the version
was as PECL had built and installed.
This had no effect, and yeilded the same behaviour.
I'm stumped as to what the issue could be, however I did see this
issue of APC not caching files on an installation of Red Hat
Enterprise Linux in the past - however at the time we assumed it was
an issue with the framework we were using and due to time constraints
simply ran without APC and didn't investigate further.
Has anyone seen this issue in the past and perhaps even rectified it?
Any information would be appreciated.
Cheers,
James
--- End Message ---
--- Begin Message ---
On Sun, Jun 21, 2009 at 5:56 PM, James McLean <[email protected]>wrote:
> (Resend from around 1 week ago, because of no responses)
>
> Hi All,
>
> Over the weekend I setup a test of APC intending to benchmark a Moodle
> installation with various APC settings to see how well I could get it
> to perform. I successfully installed Moodle 1.9 and 2.0 under Apache
> 2.2.3 (installed via apt on Ubuntu 9.04), and with PHP 5.2.9 compiled
> from source. I should note, that Ubuntu had an older version of PHP
> installed from apt with Suhosin hardened PHP built in. Moodle 2.0
> required at least PHP 5.2.8, so I uninstalled the original PHP module
> before compiling and installing the 5.2.9.
>
> No issues there; PHP worked well and performance was (mostly) acceptable.
>
> Progressed onto installing APC, firstly by downloading the APC 3.1.2
> source from PECL and following the usual 'phpize, configure, make,
> make install' process which worked as expected, stop and start Apache
> and APC was present in my phpinfo();. I started with the reccomended
> PHP config exept with error_display turned on and E_ALL | E_STRICT
> enabled, and also the reccomended APC config also.
>
> I copied the 'apc.php' from the source tree to my webroot and changed
> the password as suggested.
>
> The issue arose when I attempted to benchmark my Moodle install with
> 'ab' (I realise it only downloads the single page, but it's good
> enough for what I need for now though) and the result was no different
> to before I had installed APC. View the apc.php page, and the only
> page cached is apc.php itself.. Certainly not what I've witnessed in
> the past. Then what would happen was if I viewed my seperate info.php
> page containing simply the opening PHP tag and a single line with
> phpinfo(); in the file - the cache would appear to reset, and it would
> firstly not load the info.php into the cache, it would reset the
> counter on the apc.php file back to 0.
>
> Through all of this, there was no errors displayed on the screen and
> no errors listed in the Apache error log either. Increased the Apache
> log level up to Debug, and no related information was displayed.
> Moodle itself worked as expected with no errors, and on a seperate
> RHEL installation I have Moodle working with APC and it is caching all
> it's files as expected.
>
> At this point, I thought it may be an issue with the module I compiled
> myself. I backed up the module, and allowed PECL to install the
> module, it installed 3.0.19. Restarted Apache and verified the version
> was as PECL had built and installed.
>
> This had no effect, and yeilded the same behaviour.
>
> I'm stumped as to what the issue could be, however I did see this
> issue of APC not caching files on an installation of Red Hat
> Enterprise Linux in the past - however at the time we assumed it was
> an issue with the framework we were using and due to time constraints
> simply ran without APC and didn't investigate further.
>
> Has anyone seen this issue in the past and perhaps even rectified it?
>
> Any information would be appreciated.
did you take a look at the size of the cache you created ? also, arent you
planning to cache php opcodes, so if you load up the page, index.html, i
would expect to see a bunch of php files mentioned in the apc cache.. if
apc has support for output caching, ive not yet used it so im not sure how
much i could help there (sort of sounds like youre shooting for output
caching the way you describe things above).
maybe you could dump out your ini settings for apc and share them here?
-nathan
--- End Message ---
--- Begin Message ---
On Mon, Jun 22, 2009 at 9:40 AM, Nathan Nobbe<[email protected]> wrote:
> On Sun, Jun 21, 2009 at 5:56 PM, James McLean <[email protected]>
> wrote:
> did you take a look at the size of the cache you created ?
Yes. Tried multiple segments and single, with cache size values
between 128mb and 256mb. Also tried with stat on and off.
> also, arent you planning to cache php opcodes, so if you load up the page,
> index.html, i
> would expect to see a bunch of php files mentioned in the apc cache..
Well, index.html wouldn't be cached because it's not parsed by the PHP
engine. But yes, if it were index.php for example each compiled PHP
file is then cached in the opcode cache - include files and
everything. This is how it works on every other APC installation i've
tried :)
This installation is not doing that, even though this is the default behaviour.
> if apc has support for output caching, ive not yet used it so im not sure how
> much i could help there (sort of sounds like youre shooting for output
> caching the way you describe things above).
No, i'm not looking for output caching. Apologies if my original email
was poorly worded.
> maybe you could dump out your ini settings for apc and share them here?
No need. they're all default as reccomended by PHP and APC.
Thanks,
James
--- End Message ---
--- Begin Message ---
Can you do a phpinfo(); and tell us the value of the setting
apc.filters (or every apc.* if you can)? Just curious, but I've seen
apps set that setting to avoid APC opcode caching.
Jonathan
On Sun, Jun 21, 2009 at 8:56 PM, James McLean<[email protected]> wrote:
> (Resend from around 1 week ago, because of no responses)
>
> Hi All,
>
> Over the weekend I setup a test of APC intending to benchmark a Moodle
> installation with various APC settings to see how well I could get it
> to perform. I successfully installed Moodle 1.9 and 2.0 under Apache
> 2.2.3 (installed via apt on Ubuntu 9.04), and with PHP 5.2.9 compiled
> from source. I should note, that Ubuntu had an older version of PHP
> installed from apt with Suhosin hardened PHP built in. Moodle 2.0
> required at least PHP 5.2.8, so I uninstalled the original PHP module
> before compiling and installing the 5.2.9.
>
> No issues there; PHP worked well and performance was (mostly) acceptable.
>
> Progressed onto installing APC, firstly by downloading the APC 3.1.2
> source from PECL and following the usual 'phpize, configure, make,
> make install' process which worked as expected, stop and start Apache
> and APC was present in my phpinfo();. I started with the reccomended
> PHP config exept with error_display turned on and E_ALL | E_STRICT
> enabled, and also the reccomended APC config also.
>
> I copied the 'apc.php' from the source tree to my webroot and changed
> the password as suggested.
>
> The issue arose when I attempted to benchmark my Moodle install with
> 'ab' (I realise it only downloads the single page, but it's good
> enough for what I need for now though) and the result was no different
> to before I had installed APC. View the apc.php page, and the only
> page cached is apc.php itself.. Certainly not what I've witnessed in
> the past. Then what would happen was if I viewed my seperate info.php
> page containing simply the opening PHP tag and a single line with
> phpinfo(); in the file - the cache would appear to reset, and it would
> firstly not load the info.php into the cache, it would reset the
> counter on the apc.php file back to 0.
>
> Through all of this, there was no errors displayed on the screen and
> no errors listed in the Apache error log either. Increased the Apache
> log level up to Debug, and no related information was displayed.
> Moodle itself worked as expected with no errors, and on a seperate
> RHEL installation I have Moodle working with APC and it is caching all
> it's files as expected.
>
> At this point, I thought it may be an issue with the module I compiled
> myself. I backed up the module, and allowed PECL to install the
> module, it installed 3.0.19. Restarted Apache and verified the version
> was as PECL had built and installed.
>
> This had no effect, and yeilded the same behaviour.
>
> I'm stumped as to what the issue could be, however I did see this
> issue of APC not caching files on an installation of Red Hat
> Enterprise Linux in the past - however at the time we assumed it was
> an issue with the framework we were using and due to time constraints
> simply ran without APC and didn't investigate further.
>
> Has anyone seen this issue in the past and perhaps even rectified it?
>
> Any information would be appreciated.
>
> Cheers,
>
> James
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
On Mon, Jun 22, 2009 at 10:02 AM, Jonathan Tapicer<[email protected]> wrote:
> Can you do a phpinfo(); and tell us the value of the setting
> apc.filters (or every apc.* if you can)? Just curious, but I've seen
> apps set that setting to avoid APC opcode caching.
Certainly, however it will have to wait until I am home and have
access to that machine again. Though I'm not sure that would be the
case as APC is caching all Moodle files on my development server here.
That being said I'll grep the codebase anyway to see if it's setting
any filters.
Thanks.
--- End Message ---