View Full Version : [HOW TO] Install APC (Alternative PHP Cache)
Please refer http://forums.deftechgroup.com/showthread.php?t=850 and be clear as to 'which PHP' you are really using. Then proceed further:
# cd /usr/local/src
# wget http://pecl.php.net/get/APC-3.0.8.tgz
# gunzip -c APC-3.0.8.tgz | tar xf -
# cd APC-3.0.8[/B]
# /usr/bin/phpize
# ./configure --enable-apc --enable-apc-mmap --with-apxs --with-php-config=/usr/bin/php-config
# make
# make install
# pico /usr/local/lib/php.ini
# service httpd restartNOTES:
1. /usr/bin/phpize: The file might be in another location on your server, so as I said earlier make sure which files of PHP you are using.
2. --with-php-config=/usr/bin/php-config: Same as Note #1 above.
3. pico /usr/local/lib/php.ini: Same as Note # 1 above.
Also add the following line within the Dynamic Extensions section
extension="/usr/..../.../.../apc.so"
The actual path is displayed on the screen when you run make install command
BornOnline
11-03-2005, 05:20 PM
Thanks Zaf.. looking at http://pecl.php.net/package/APC site now. Ok, I see the config options in the download install file.
So, this seems to offer better performance? I'm running eaccel 0.9.3 still.
Just wondering and thanks again!
O.. what you say Elix? I heard you are using this :)
Better Performance? Yes (Non-Authoritative as I never had EA on the same VPS before)
If you need to see the status whether its running or not, phpinfo() gives that out for you.
About the config options, I have the defaults for now, and the INSTALL file in the gz file gives description of the same.
Btw, Elix got rid of Eaccel for this.....afaik he's happy, and you should see him write something as sooon as he sees this thread (i hope). ;-)
BornOnline
11-03-2005, 05:32 PM
Work with Zend too? According to this (http://www.faqs.org/docs/apache-compile/phpext.html) it will not, but this may be old info. I'll do more reading before I bust in here.
One more thing.. some good info on Wikimedia (http://meta.wikimedia.org/wiki/PHP_caching_and_optimization)
Very little info but in the right thread and quite recent too.
http://www.vbulletin.com/forum/showthread.php?t=75878&page=38
BornOnline
11-03-2005, 07:07 PM
Just installed and everything looked good in phpinfo. Pages would initially load, but when I clicked anything it basically just refreshed the same page even if I typed in or clicked another link :confused:
I double checked my config and it all looked good. I'm going to read up and rebuild it again.
Thanks again
BornOnline
11-04-2005, 06:04 PM
Still no luck.. same results. Pages will load, but click anything and the same page loads? Anyone have any idea?
Have you changed any settings for APC or left it to defaults? Sharing them might give some clue to readers here. I wonder how many have even tried it yet. Nobody, except you and me seem to be talking about it over here.
ozgreg
11-04-2005, 07:14 PM
I also had a go at installing APC (See http://forums.deftechgroup.com/showthread.php?t=717) and it failed to perform at the same level as Eacc (see below)
"During Test noticed Multiple [notice] child pid xxxx exit signal Segmentation faults in error_log. Concluded APC appears to have runtime issues in the current hosting environment, switching back to eaccelerator"
Still no luck.. same results. Pages will load, but click anything and the same page loads? Anyone have any idea?
make sure the optimization is disabled as that is experimental and caused issues for me.
Wow never knew that thread existed, wish had done a search before starting this thread :) Now, I wish we could move relevant posts to the other thread and delete the rest to avoid confusion for the rest who might refer later.
Ed: Thanks Oz, me uninstalling too, wonder what causes those errors anyway.
i see seg faults as well..:( just disabled APC, I might reinstall eaccelerator, not sure yet.
ozgreg
11-06-2005, 08:37 PM
No worries, I had wondered why you did not spot the thread, I tried compiling APC a few different ways but I kept on getting the seg faults.. The other option I was thinking of exploring was dropping ZEND and just utilising APC.
Eacc does a ok job, I still see (daily) eacc errors in my errorlog,,
Running zend and eaccelerator, with it cleaning the cache every 2hrs. Works great but I only host couple sites and one major traffic one. None of the hosting you guys do. No errors to report that i know of.
funkmeister
11-08-2005, 12:50 AM
For those of you running eAccelerator....what version of PHP are you running with? I've found it won't load with PHP 4.4.1 so having to stick with 4.3.11 - any ideas how to get it to work with 4.4.1?
Cheers.
BornOnline
11-08-2005, 09:33 AM
Working fine with 4.4.1 I had a problem with it not loading, but found out I needed to run phpize from /usr/local/bin and not /usr/bin. After I did that it loaded fine.
funkmeister
11-08-2005, 10:55 AM
Ok, thanks for the info. Think I saw mention of how to do that in another thread.....will check it out. Now just need to get mySQL to 4.1.15 as cPanel only has 4.1.1.3 :(
Ok, thanks for the info. Think I saw mention of how to do that in another thread.....will check it out. Now just need to get mySQL to 4.1.15 as cPanel only has 4.1.1.3 :(
I think in Current and Edge trees they do have it, but it's not rolled out to release yet
funkmeister
11-08-2005, 11:03 PM
Do you know if there is a "usual" set timeframe when they move from Current & Edge trees to the actual release? Just trying to hazard a guess-timate when it might be available.
Just trying to hazard a guess-timate when it might be available.Even wildest guess-timates fail with cPanel. At times they change on hourly basis, while other times even weekly basis :)
ozgreg
11-28-2005, 03:47 AM
Well I have some good news on APC. It turns out that you must disable ZEND Optimizer & restart your apache before compiling APC.
After making, then enable APC in the httpd (leaving Zend optimizer off) and you are set.. APC performace is roughly the same as Eacc + Zend Optimizer plus it is well maintained (and seems to be more stable)
Rumour has it that php 6 will have APC rather than Zend Optimizer..
Rumour has it that php 6 will have APC rather than Zend Optimizer..Yes I've read about that one too :) and yes that was the primary reason to choose APC :)
mikelbeck
11-29-2005, 10:51 AM
And what if you have an application that requires Zend Optimizer? I'm running whois.cart, it needs it and won't run... Can APC and Zend co-exist?
BornOnline
11-29-2005, 07:34 PM
Thanks for the tip ozgreg. Installed last night and everything seems fine.
I have to remove it though since DRAMS needs Zend :(
You guys don't understand...
take out Zend Optimizer, but you can leave the Zend Extensions.
See my phpinfo
http://my.medialayer.com/phpinfo.php
mikelbeck
11-29-2005, 08:20 PM
You guys don't understand...
take out Zend Optimizer, but you can leave the Zend Extensions.
See my phpinfo
http://my.medialayer.com/phpinfo.php
What about applications that are Zend encoded? Will they continue to run?
BornOnline
11-29-2005, 08:22 PM
Ok cool. I think this is working now with Zend encoded sites.
Took this out
;zend_extension="/usr/local/Zend/lib/ZendOptimizer.so"
and left the ones below
Are any of these not needed? I'm wondering if these are leftover from an old version or are these four lines normal?
zend_extension_manager.optimizer=/usr/local/Zend/lib/Optimizer-2.5.10
zend_extension_manager.optimizer_ts=/usr/local/Zend/lib/Optimizer_TS-2.5.10
zend_extension=/usr/local/Zend/lib/ZendExtensionManager.so
zend_extension_ts=/usr/local/Zend/lib/ZendExtensionManager_TS.so
Elix.. are you running the default config or have you added to php.ini?
BornOnline
11-29-2005, 08:24 PM
From what I can tell yes! :D
Double checking..lol
Not sure if it related somehow, but this is a first
load average: 0.00
What about applications that are Zend encoded? Will they continue to run?
BornOnline
11-29-2005, 08:35 PM
Ok party cancel... seems it's enabled and zend optimized sites are working, but nothing is being cached from what I can tell.
90% misses
strange..
Ok.. I probably need to recompile/reinstall since I totally had zend disabled last time.
What about applications that are Zend encoded? Will they continue to run?
Yes--they will continue to run.
BornOnline
11-29-2005, 08:52 PM
I can't seen to get DRAMS to run with just the extension manager. I'm going to check with them, but back to EA for now.
Thanks for the tips.
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies with Zend Extension Manager v1.0.8, Copyright (c) 2003-2005, by Zend Technologies
This file was encoded by the Zend Encoder / Zend SafeGuard Suite
In order to run it, please install the freely available Zend Optimizer, version 2.1.0 or later.
mikelbeck
11-29-2005, 09:30 PM
Yes--they will continue to run.
Ok... I'll give it a shot.
mikelbeck
11-29-2005, 10:11 PM
I tried to edit my previous post, but it locked up on me...
How do I disable Zend optimizer but leave the extensions active for my Zend encoded apps will continue to function?
I have this under [Zend]
[Zend]
zend_extension=/usr/local/Zend/lib/ZendExtensionManager.so
zend_extension_ts=/usr/local/Zend/lib/ZendExtensionManager_TS.so
I can't seen to get DRAMS to run with just the extension manager. I'm going to check with them, but back to EA for now.
Thanks for the tips.
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies with Zend Extension Manager v1.0.8, Copyright (c) 2003-2005, by Zend Technologies
This file was encoded by the Zend Encoder / Zend SafeGuard Suite
In order to run it, please install the freely available Zend Optimizer, version 2.1.0 or later.
Sometimes poorly designed software checks to see if Zend Optimizer exists rather than if Zend extensions exist.
mikelbeck
11-30-2005, 04:11 PM
Sometimes poorly designed software checks to see if Zend Optimizer exists rather than if Zend extensions exist.
I've got the same issue with whois.cart(), it says Zend Optimizer isn't installed and won't run.
I will do some experimenting in a few hours to see if I can come up with a work-a-round.
ozgreg
11-30-2005, 05:33 PM
I've got the same issue with whois.cart(), it says Zend Optimizer isn't installed and won't run.
Just a little clarification for others..
Zend API extensions are native to PHP, if you run phpize you will see the API's listed.
Zend optimizer is an optional free commercially licensed php script cache system
APC replaces Zend Optimizer so DO NOT use them together.
APC is a open source php script cache, co-written by a number of php developers.
Native APC without the optimizer switch has a better performance than Zend Optimizer
APC running with the optional optimiser setting the equivalent of Zend Optimizer + e-accelerator
Just a little clarification for others..
Zend API extensions are native to PHP, if you run phpize you will see the API's listed.
Zend optimizer is an optional free commercially licensed php script cache system
APC replaces Zend Optimizer so DO NOT use them together.
APC is a open source php script cache, co-written by a number of php developers.
Native APC without the optimizer switch has a better performance than Zend Optimizer
APC running with the optional optimiser setting the equivalent of Zend Optimizer + e-accelerator
it appears the optimizer setting breaks phpBB but I am not sure if it does without zendopt--last time I tried it, it was with zendopt
mikelbeck
11-30-2005, 08:03 PM
it appears the optimizer setting breaks phpBB but I am not sure if it does without zendopt--last time I tried it, it was with zendopt
Which optimizer? Zend?
That causes 1 issue, afaik, and it's a relatively simple fix. I've got a load of phpBB sites running on my VPS, plus Zend Optimizer.
Which optimizer? Zend?
That causes 1 issue, afaik, and it's a relatively simple fix. I've got a load of phpBB sites running on my VPS, plus Zend Optimizer.
nope--the apc optimizer setting. However.. I just tried it myself and it does help a lot with performance and phpBB appears to work Ok with it too.
edit-- my load is currently .09 after enabling apc optimizer :). There are also 155 connections to Apache too, so it's not like it's not peak hours either :)
shoopie
11-30-2005, 08:48 PM
i see zend is working and i see the apc module in phpinfo... that is only when i disable apc (apc.enabled=0) but when i enable apc (apc.enabled=1) apache crashes, this is my current settings...
extension="/usr/local/src/APC-3.0.8/modules/apc.so"
apc.enabled=0
apc.shm_segments=1
apc.shm_size=30
apc.optimization=0
apc.num_files_hint=1000
apc.ttl=0
apc.gc_ttl=3600
apc.cache_by_default=1
apc.filters=NULL
apc.mmap_file_mask=NULL
apc.slam_defense=0
apc.file_update_protection=2
apc.enable_cli=0
apc.user_entries_hint=100
apc.user_ttl=0
so whats the deal? :confused:
what are your zend settings?
shoopie
11-30-2005, 09:04 PM
what are your zend settings?
[Zend]
zend_optimizer.optimization_level=15
zend_extension_manager.optimizer=/usr/local/Zend/lib/Optimizer-2.5.7
zend_extension_manager.optimizer_ts=/usr/local/Zend/lib/Optimizer_TS-2.5.7
zend_extension=/usr/local/Zend/lib/ZendExtensionManager.so
zend_extension_ts=/usr/local/Zend/lib/ZendExtensionManager_TS.so
this is all i have
I just commented out Zend Optimizer...try it like this
[Zend]
;zend_optimizer.optimization_level=15
;zend_extension_manager.optimizer=/usr/local/Zend/lib/Optimizer-2.5.7
;zend_extension_manager.optimizer_ts=/usr/local/Zend/lib/Optimizer_TS-2.5.7
zend_extension=/usr/local/Zend/lib/ZendExtensionManager.so
zend_extension_ts=/usr/local/Zend/lib/ZendExtensionManager_TS.so
shoopie
11-30-2005, 09:14 PM
I just commented out Zend Optimizer...try it like this
[Zend]
;zend_optimizer.optimization_level=15
;zend_extension_manager.optimizer=/usr/local/Zend/lib/Optimizer-2.5.7
;zend_extension_manager.optimizer_ts=/usr/local/Zend/lib/Optimizer_TS-2.5.7
zend_extension=/usr/local/Zend/lib/ZendExtensionManager.so
zend_extension_ts=/usr/local/Zend/lib/ZendExtensionManager_TS.so
tried it but to no luck... how do you disable zend completely?
[Zend]
;zend_optimizer.optimization_level=15
;zend_extension_manager.optimizer=/usr/local/Zend/lib/Optimizer-2.5.7
;zend_extension_manager.optimizer_ts=/usr/local/Zend/lib/Optimizer_TS-2.5.7
;zend_extension=/usr/local/Zend/lib/ZendExtensionManager.so
;zend_extension_ts=/usr/local/Zend/lib/ZendExtensionManager_TS.so
Edit-I'd suggest taking out APC now, then reinstalling Zend with the latest version, I believe your version is old.
ozgreg
12-01-2005, 12:09 AM
you can remove Zend Optimizer by commenting out all the lines in the Zend section of your php.ini
ozgreg
12-01-2005, 07:52 PM
I spent a few days optimising APC and come up with these settings..
[APC]
apc.gc_ttl=15
apc.ttl=3600
apc.gc_ttl -> 15 seconds to remove a thread of the garbage list. Since Apache kills a session after 15 seconds after timeout / disconnection this is fairly safe to use.
apc.ttl -> 3600 seconds (1 HR ) to expire a script in the cache, you can decrease this to ensure your cache always remains "fresh" depending on how much traffic you are getting or increase your cache which also increases the amount of memory APC will be consuming..
Leave the other settings as per default. I would also STRONGLY recommend installing the apc.php page as it shows a full breakdown of your current APC cache..
I am getting around 70% cache hits right now which considering my sites are dynamic mysql php sites that is not a bad average and I am not getting the e-acc child errors I was getting from time to time in the error.log :-)
my VE is doing excellent with APC, I have to say it makes a huge difference.
ozgreg
12-01-2005, 09:24 PM
Yeah mine is humming along very nicely as well.. I like the APC stats page and it just feels a lot more stable..
Would have been nice if they listed the known ZEND optimiser incompatibility so we could have had this running a few months ago when I first tried..
ryancramer
12-02-2005, 11:09 AM
I can't seem to get APC going on my PowerVPS system. Have installed according to these instructions and the installation appears to be successful and apc.php reports everything as functioning, as does phpinfo().
What I'm finding is that I get nothing but misses and nothing seems to stay in the cache beyond each request. For instance, apc.php reports it is the only file in the cache. If I run a PHP script and call apc_cache_info() I only get files in the cache specific to the the single request (and misses at that).
I have a separate VPS with another company and also performed an identical installation there. APC is functioning as it should with that installation. Looking in the cache via php_cache_info() shows hundreds of files rather than just the currently executing script. And the server is noticably faster. But no such luck with my PowerVPS system.
I'm struggling to figure out why APC won't work properly here. The only real difference between the two systems is that I'm using PHPsuExec on the PowerVPS, and not using it on the other. Could using PHPsuExec prevent APC from working? I've not found anything in my searches that would indicate a conflict here, but it's the only difference between my two systems from what I can tell.
I've kept a close eye on apache's error_log and there are no errors or indications of a problem with apc.
My php.ini is consistent with the APC install file, and I've commented out all the zend optimization stuff, so I'm quite certain that the problem is not here. But here's what I've got (just in case):
extension_dir = /usr/local/lib/php/extensions/no-debug-non-zts-20020429/
extension=apc.so
; zend_optimizer.optimization_level=15
; zend_extension_manager.optimizer=/usr/local/Zend/lib/Optimizer-2.5.7
; zend_extension_manager.optimizer_ts=/usr/local/Zend/lib/Optimizer_TS-2.5.7
zend_extension=/usr/local/Zend/lib/ZendExtensionManager.so
zend_extension_ts=/usr/local/Zend/lib/ZendExtensionManager_TS.so
Of course, apache has also been restarted (several times at this point). Any ideas?
Thanks,
Ryan
Yes - I believe phpsuexec can cause issues for php cache addons such as APC and eA.
ryancramer
12-02-2005, 05:26 PM
Thanks. Recompiling Apache (without PHPsuExec) fixed the problem. APC now running smoothly.
Ryan
ozgreg
12-02-2005, 09:13 PM
I just found out that Gallery2 / APC have known issues (which explains why after x hours my server load would start to creep up) so I had to switch back to Eacc :-(
So a little tip, if you are running Gallery2 (and you should be as is really is a very nice piece of graphics software) you have to switch back to e-acc :-(
I just found out that Gallery2 / APC have known issues (which explains why after x hours my server load would start to creep up) so I had to switch back to Eacc :-(
So a little tip, if you are running Gallery2 (and you should be as is really is a very nice piece of graphics software) you have to switch back to e-acc :-(
Why can't you just use some sort of .htaccess to disable APC for that domain?
Carlos Camacho
12-08-2005, 04:14 AM
Hi all,
I recently found out about APC, after a tech from vBulletin strongly recommended it to me for best vBulletin performance. Since I'm not so great at Linux, I asked support if they could install it for me. Support wrote back...
Since you are using a plesk server, please stick to rpm usage. I can find only the tar files for APC in the URL that you provided. Going for a php build from source for integrating APC can break many of the plesk features. So it is best you leave it the way it is.
Can someone advise me? I heard that only SiteManager in Plesk uses ionCube.
If it helps, php -v on my server gives:
PHP 4.3.11 (cgi) (built: May 25 2005 00:05:07)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies
with the ionCube PHP Loader v2.5, Copyright (c) 2002-2004, by ionCube Ltd.
Cheers,
Carlos Camacho
12-18-2005, 08:36 PM
Can someone comment on my question in post #57 (above)? I'd still not sure if it is OK to install APC on Plesk machines. :(
GalCom
02-07-2006, 04:57 AM
Has anyone had any luck using APC with PHP 5? I've been trying to get it installed for the last couple of hours, without any luck. Everything seems to go ok, but phpinfo shows no mention of it :confused: I got it working ok a while ago on another VPS running PHP 4, so I'm wondering if it's some sort of incompatibility issue with php 5?
I have the same issue, but i think it's something to do with PHPSuExec being enabled.
David
Hey everyone,
I have used WHME - search for it, its free for non-commercial use so as long as you don't offer it in your reseller packages then no problem :)
It includes auto configuration module for APF, and BFD, and has WHM interface control panel for blocking and allowing IP's, and more... It seems to work fine with PHP5 for me, and its pretty easy to use and install :D
StingRay
02-07-2006, 10:43 AM
Hi all,
I recently found out about APC, after a tech from vBulletin strongly recommended it to me for best vBulletin performance. Since I'm not so great at Linux, I asked support if they could install it for me. Support wrote back...
Can someone advise me? I heard that only SiteManager in Plesk uses ionCube.
If it helps, php -v on my server gives:
Cheers,
AFAIK you cannot have Zend+IonCube+APC or Eacc
You would have to disable IonCube, or Zend in order to get APC or Eacc working.
Hey everyone,
I have used WHME - search for it, its free for non-commercial use so as long as you don't offer it in your reseller packages then no problem :)
It includes auto configuration module for APF, and BFD, and has WHM interface control panel for blocking and allowing IP's, and more... It seems to work fine with PHP5 for me, and its pretty easy to use and install :D
WHME?
I googled and didn't find anything.
How is it related to APC?
http://img356.imageshack.us/img356/6946/41xo.jpg :p
SludgeMeister
04-26-2006, 02:51 AM
It seems APC is running fine now, but I got a little puzzled on one part of the guide over at WHT, it stated:
Locate extension_dir and change it to the path taken in step 9. For example, my make install returned /usr/lib/php4, therefore my extension variable reads as follows
; Directory in which the loadable extensions (modules) reside.
extension_dir = "/usr/lib/php4"
As default its set to:
; Directory in which the loadable extensions (modules) reside.
extension_dir = "./"
Another guide over at vBulletin doesn't say to change that part...Do I leave it as is, or change it?
I actually changed it originally to point to the dir:
/usr/lib/php/extensions/no-debug-........
And APC seemed to be running (in php info), but I removed it and replaced that line on the actual "extension=" line, and reloaded php info and it now looks as if its "properly" running (theres a table now with data and such, which wasnt there when I have extension_dir= set different).
I'd appreciate a little help with this, is this the right thing to do? leave extension_dir= to ./?
The original WHT instructions are below.
P.S.
The Zend Conflict...I only have Zend Engine installed, that doesn't cause any conflicts I assume?
This program makes use of the Zend Scripting Language Engine:
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies
The instructions I followed are:
PHP-APC
3. Move to a source directory
# cd /usr/local/src
4. Download the latest binary (http://pecl.php.net/package/APC)
# wget -c "http://pecl.php.net/get/APC-3.0.8.tgz"
5. Extract the tarball
# tar -xvzf APC-3.0.8.tgz
6. Move into folder
# cd APC-3.0.8
7. Run the phpize (See step 1)
# /usr/bin/phpize
8. Configure it (See step 2)
# ./configure --with-php-config=/usr/bin/php-config --enable-apc-mmap --enable-apc
9. Compile & Install (Take note of 'Installing Shared Extension')
# make install
10. PHP.ini configuration
# whereis php.ini
Locate extension_dir and change it to the path taken in step 9. For example, my make install returned /usr/lib/php4, therefore my extension variable reads as follows
Quote:
; Directory in which the loadable extensions (modules) reside.
extension_dir = "/usr/lib/php4"
Now locate 'Dynamic Extensions', paste the following underneath
Quote:
extension="apc.so"
apc.enabled ="1"
apc.max_file_size="2M"
apc.slam_defense="50"
apc.shm_size = "32"
11. Restart HTTPD
# /etc/init.d/httpd restart
11. Test
Create a phpinfo file <?php phpinfo(); ?> and search for APC to ensure it is enabled and optimizing correctly
eAccelerator
3. Move to a source directory
# cd /usr/local/src
4. Download the latest binary (http://eaccelerator.net/DownloadEacceleratorUk)
# wget -c "http://easynews.dl.sourceforge.net/sourceforge/eaccelerator/eaccelerator-0.9.4-rc1.tar.bz2"
5. Extract the tarball
# tar -xvjf eaccelerator-0.9.4-rc1.tar.bz2
6. Move into folder
# cd eaccelerator-0.9.4-rc1
7. Run the phpize (See step 1)
# /usr/bin/phpize
8. Configure it (See step 2)
# ./configure --with-php-config=/usr/bin/php-config --enable-eaccelerator=shared
9. Compile & Install (Take note of 'Installing Shared Extension')
# make install
10. PHP.ini configuration
# whereis php.ini
It looks like your fine from everything you posted, no need to worry.
Can you show us the output of php -v and/or php -i | grep APC in shell?
SludgeMeister
04-26-2006, 03:44 PM
Thanks for the reply Elix,
php -v shows:
PHP 4.4.1 (cgi) (built: Apr 25 2006 18:37:56)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies
and php -i | grep APC shows nothing, no error just no result.
updatedb; locate apc.so
try that - note it may take some time for the initla part of the command (updatedb)
paste me the output at the end, though
SludgeMeister
04-26-2006, 04:20 PM
updatedb; locate apc.so came back with:
/usr/lib/php/extensions/no-debug-non-zts-20020429/apc.so
/usr/local/src/APC-3.0.10/.libs/apc.so
/usr/local/src/APC-3.0.10/modules/apc.so
btw, info.php reports:
APC Support enabled
Version 3.0.10
MMAP Support Enabled
MMAP File Mask no value
Revision $Revision: 3.84 $
Build Date Apr 26 2006 07:19:23
apc.cache_by_default On On
apc.enable_cli Off Off
apc.enabled On On
apc.file_update_protection 2 2
apc.filters no value no value
apc.gc_ttl 3600 3600
apc.max_file_size 2M 2M
apc.mmap_file_mask no value no value
apc.num_files_hint 1000 1000
apc.optimization Off Off
apc.shm_segments 1 1
apc.shm_size 32 32
apc.slam_defense On On
apc.stat On On
apc.ttl 0 0
apc.user_entries_hint 100 100
apc.user_ttl 0 0
LordMerlin
04-27-2006, 05:36 AM
I can't seem to get this installed on my VPS.
After running make install, I get this:
root@gandalf [/installs/APC-3.0.8]# make install
Installing shared extensions: /usr/local/lib/php/extensions/no-debug-non-zts-20020429/
root@gandalf [/installs/APC-3.0.8]# ls /usr/local/lib/php/extensions/no-debug-non-zts-20020429/
./ ../ apc.so* eaccelerator.so*
Adding /usr/local/lib/php/extensions/no-debug-non-zts-20020429/apc.so to php.ini, gives me this:
/usr/local/lib/php/extensions/no-debug-non-zts-20020429/apc.so doesn't appear to be a valid Zend extension
root@gandalf [/installs/APC-3.0.8]# locate php_apc.so
root@gandalf [/installs/APC-3.0.8]# locate php_apc
/installs/APC-3.0.8/php_apc.c
/installs/APC-3.0.8/php_apc.h
/installs/APC-3.0.8/php_apc.lo
/installs/APC-3.0.8/php_apc.o
I don't seem to have
/usr/local/apc/php_apc.so
Any suggestions?
Navigate to /usr/local/lib/php/extensions/no-debug-non-zts-20020429
Is apc.so located in that folder?
Did you let make and make install run fully before adding the extension to php.ini?
I know my install took about 15 minutes for one of the make commands to run fully.
Did you disable Zend optimizer?
David
LordMerlin
04-27-2006, 06:45 AM
I did run make & make install as per the instructions. Then I ran into some serious problems with my apache, which kept on failing. After contact support, and they fixed it all, they suggested I install APC, which also doesn't seem to work, can't find the right .so file
In the meantime I upgraded Zend to version 3.0, and for some odd reason my server load is extemely high
top - 12:45:49 up 35 days, 13:35, 2 users, load average: 19.72, 18.20, 15.52
Tasks: 105 total, 22 running, 82 sleeping, 1 stopped, 0 zombie
Cpu(s): 98.6% user, 1.4% system, 0.0% nice, 0.0% idle
Mem: 8211120k total, 7970124k used, 240996k free, 2258076k buffers
Swap: 8193140k total, 2562816k used, 5630324k free, 2359512k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
15814 root 20 0 9504 9504 4316 R 9.6 0.1 11:41.13 php
27536 root 20 0 9504 9504 4316 R 9.6 0.1 7:41.53 php
2244 root 20 0 9504 9504 4316 R 9.6 0.1 1:57.61 php
2801 root 20 0 9504 9504 4316 R 9.6 0.1 0:32.54 php
3719 softdux 20 0 6376 6376 3940 R 9.3 0.1 1:11.49 php
2561 root 18 0 9504 9504 4316 R 8.9 0.1 1:23.83 php
27744 root 18 0 9504 9504 4316 R 8.9 0.1 0:57.15 php
27536 root 15 0 9504 9504 4316 R 8.9 0.1 7:41.24 php
5501 root 15 0 9504 9504 4316 R 8.9 0.1 6:25.43 php
3719 softdux 16 0 6376 6376 3940 R 8.9 0.1 1:11.21 php
10529 softdux 14 0 6376 6376 3940 R 8.6 0.1 17:09.21 php
14567 root 15 0 9504 9504 4316 R 8.6 0.1 3:49.88 php
22662 root 15 0 9504 9504 4316 R 8.3 0.1 9:21.46 php
16918 root 15 0 9504 9504 4316 R 8.3 0.1 4:30.01 php
28175 root 15 0 9504 9504 4316 R 8.3 0.1 3:07.04 php
2244 root 15 0 9504 9504 4316 R 8.3 0.1 1:57.32 php
2561 root 15 0 9504 9504 4316 R 8.3 0.1 1:23.56 php
27744 root 15 0 9504 9504 4316 R 8.3 0.1 0:56.88 php
2801 root 15 0 9504 9504 4316 R 8.3 0.1 0:32.25 php
31870 root 10 0 992 992 752 R 0.7 0.0 0:29.24 top
4595 root 9 0 5848 3484 2868 S 0.3 0.0 0:00.01 cppop
1 root 8 0 552 508 480 S 0.0 0.0 0:55.96 init
31713 root 9 0 576 544 492 S 0.0 0.0 1:48.45 syslogd
And I'm not sure why. Restarting apache doesn't fix it.
hmm are you running PHP as mod_php, because that looks like suexec?
btw
APC doesn't install as a zend extension nor does it work with zend optimizer
LordMerlin
04-27-2006, 07:49 AM
How do I tell?
I can't install eaccelerator, and support suggested I should install APC instead, which doesn't seem to work either.
This is what I have:
root@gandalf [/installs/ZendOptimizer-3.0.0-linux-glibc21-i386]# php -v
PHP 4.4.1 (cli) (built: Apr 26 2006 16:51:45)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies
with Zend Extension Manager v1.0.10, Copyright (c) 2003-2006, by Zend Technologies
with Zend Optimizer v3.0.0, Copyright (c) 1998-2006, by Zend Technologies
Do I need either of these then? If not, how do I uninstall it?
You need to disable Zend Optimizer for APC to work properly.
You can do that by going to the end of your php.ini file and commenting out the line which starts it.
To do that, you add a; to the beginning of the line.
David
How do I tell?
I can't install eaccelerator, and support suggested I should install APC instead, which doesn't seem to work either.
This is what I have:
root@gandalf [/installs/ZendOptimizer-3.0.0-linux-glibc21-i386]# php -v
PHP 4.4.1 (cli) (built: Apr 26 2006 16:51:45)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies
with Zend Extension Manager v1.0.10, Copyright (c) 2003-2006, by Zend Technologies
with Zend Optimizer v3.0.0, Copyright (c) 1998-2006, by Zend Technologies
Do I need either of these then? If not, how do I uninstall it?
Sounds like you have a mess of a setup there. eA should work tho, I would be willing to help if access was provided.
LordMerlin
04-28-2006, 04:38 AM
What exactly does APC do different than eAccelerator, than Zend optimizer? Cause I want to weight it down whether it's worth to install either of these. If my server's going to be down again for a whole day, then I can't install it.
If my server's going to be down again for a whole day
uhhh that shouldn't happen >_>;;
APC and eAccelerator are pretty similar to my understanding.
They both cache and speed up PHP code a lot better than Zend does.
David
dmspilot
04-30-2006, 01:28 AM
Do these cache programs help to speed up PHP if I have it setup to run under CGI mode instead of as the Apache module? I've installed APC but don't see much difference.
They should speed it up, yes.
Do you have the APC php script to see stats about the APC installation?
You can copy it out of the source directory to a viewable location.
I've only installed APC under php running as an apache module. It didn't work when PHPSuExec was installed which uses the CGI version.
David
SludgeMeister
05-06-2006, 03:38 PM
Hmm, I've upgraded my PVPS account to power-2 (new server) so am installing this again. I've run into a few problems it seems. The install went "ok" it seems, but APC is now not showing in phpinfo, I ran the following:
root@host [~/temp/APC-3.0.10]# php -v
PHP 4.4.2 (cli) (built: Feb 12 2006 02:24:06)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies
root@host [~/temp/APC-3.0.10]# php -i | grep APC
PWD => /root/temp/APC-3.0.10
_SERVER["PWD"] => /root/temp/APC-3.0.10
_ENV["PWD"] => /root/temp/APC-3.0.10
root@host [~/temp/APC-3.0.10]# updatedb; locate apc.so
/root/temp/APC-3.0.10/.libs/apc.so
/root/temp/APC-3.0.10/modules/apc.so
/usr/lib/php/extensions/no-debug-non-zts-20020429/apc.so
Sort of a little lost - I havent modified php.ini OTHER than adding:
extension="apc.so"
apc.enabled ="1"
apc.max_file_size="2M"
apc.slam_defense="50"
apc.shm_size = "32"
Under "Dynamic Extensions".
Any ideas?
EDIT: Ok it seems to be showing in phpinfo now (and says APC is enabled), I made the following modification in php.ini:
Changed: extension_dir = ./
To
extension_dir =/usr/lib/php/extensions/no-debug-non-zts-20020429/
Can you confirm if this is the right thing to do?
php -i | grep APC shows the following though:
root@host [~/temp/APC-3.0.10]# php -i | grep APC
APC Support => disabled
PWD => /root/temp/APC-3.0.10
_SERVER["PWD"] => /root/temp/APC-3.0.10
_ENV["PWD"] => /root/temp/APC-3.0.10
Thanks
Only think i can think of is you didnt phpize correctly.
Make sure your using the right php bin folder.
which php
SludgeMeister
05-07-2006, 01:35 AM
Thanks for the reply Hvu!
phpize ran fine and the path I believe is correct :/
T.
SludgeMeister
05-07-2006, 04:46 PM
Have tried the reinstall again, APC is now showing in phpinfo fine, and php -i | grep APC comes back with:
root@host [/usr/local/src/APC-3.0.10]# php -i | grep APC
PWD => /usr/local/src/APC-3.0.10
_SERVER["PWD"] => /usr/local/src/APC-3.0.10
_ENV["PWD"] => /usr/local/src/APC-3.0.10
Also in phpinfo it shows under PHP Variables:
_ENV["PWD"] /usr/local/src/APC-3.0.10
And under Environment:
PWD /usr/local/src/APC-3.0.10
Not sure if that should be there?
I followed the vBulletin guide install of 3 different guides at once :P and added the following to php.ini (and nothing else):
extension="/usr/lib/php/extensions/no-debug-non-zts-20020429/apc.so"
apc.shm_size = 32
Thanks
mikekey
06-25-2006, 02:30 PM
I can't get it to show up in my phpinfo ??
vBulletin® v3.8.4, Copyright ©2000-2010, Jelsoft Enterprises Ltd.