Tag Info

Hot answers tagged

61

Installing PHP 5.4.* on Ubuntu 12.04 Simply add the PPA repository: sudo add-apt-repository ppa:ondrej/php5-oldstable And install it: sudo apt-get update sudo apt-get install php5 NB! For latest version of PHP (currently 5.5.1) add the PPA repository: sudo add-apt-repository ppa:ondrej/php5


58

Note: prepend sudo if not root Using SysV Init scripts directly: /etc/init.d/php-fpm restart # typical /etc/init.d/php5-fpm restart # debian-style Using service wrapper script service php-fpm restart # typical service php5-fpm restart # debian-style Using Upstart (e.g. ubuntu): restart php5-fpm # typical (ubuntu is debian-based) ...


51

This is perfectly normal. At system startup, a number of services start. These services initialize themselves, read in configuration files, create data structures and so on. They use some memory. Many of these services will never run again for the entire time the system is up because you're not using them. Some of them may run in hours, days, or weeks. Yet ...


45

You probably want to see the PHP Client Comparison. Short version: They will both work, and for most cases either one will do just fine. Regarding the other issue: Yes, you should be able to do telnet 127.0.0.1 11211. Very few firewalls would block localhost from communicating with itself. If you are not able to connect, verify that memcached really is ...


37

maybe they use tail -f on the access log?


37

Whoever was making this argument seems to be saying "Once someone has their foot in the door, you might as well give them complete access". By that logic, a firewall negates the need for all passwords on your internal network. Strong passwords are one step towards limiting the damage done by network intrusion. There's no reason to throw your hands up in ...


32

Using mod_php each Apache worker has the entire PHP interpreter loaded into it. Because Apache needs one worker process per incoming request, you can quickly end up with hundreds of Apache workers in use, each with their own PHP interpreter loaded, consuming huge amounts of memory. (Note, this isn't exactly true, Apache's worker_mpm allows you to serve many ...


31

Disclaimer: You'd be mad to listen to me without doing a tonne of testing AND getting a 2nd opinion from someone qualified - I'm new to this game. The efficiency improvement idea proposed in this question won't work. The main mistake that I made was to think that the order that the memcached stores are defined in the pool dictates some kind of priority. ...


30

Accourding to the packages.ubuntu.com page about php-apc the file can be found compressed here /usr/share/doc/php-apc/apc.php.gz. If you don't want do look online you can query the list of files installed by the package managment system by using a command like dpkg -L apc.php.


30

I also agree there is a lack of tutorials for people who just need a script to send, e.g. error emails, and don't need a full-blown mail server. First, if postfix not already installed do: sudo apt-get install postfix It prompts with a couple of questions. For the first I chose "Internet site"; for a machine behind a firewall I might choose smarthost ...


29

Try yum install pcre-devel before installing APC. On Debian use aptitude install libpcre3-dev instead.


29

You need VS C++ 2012. Go here: http://www.microsoft.com/en-us/download/details.aspx?id=30679 You need to download the x86 version if you install the 64bit version it will give the same error.


23

$ sudo apt-get install php5-cli Should do it.


23

For me, setting the ServerName property in httpd.conf fixed the delays (they were up to 10 seconds at worst): # ServerName gives the name and port that the server uses to identify itself. # This can often be determined automatically, but we recommend you specify # it explicitly to prevent problems during startup. # # If your host doesn't have a registered ...


22

As Nate's link suggests, both work perfectly well for simple usage. However, memcached supports more features that allow you to get the most performance out of memcached. The binary protocol reduces the amount of data required to be sent between client and server. Multigets and multisets allow you to get/set multiple items at the same time. If you're finding ...


22

The products you list serve different purposes. OPCode caches There are many PHP Accelerators (OPCaches) as seen on this Wikipedia list. As is common with open source products, they are all fairly similar. XCache is the lighttp PHP accelerator, and is the default choice when you are running that HTTPd. It works well with Apache as well, however APC ...


20

The short answer: Either one is what you are looking for, but my first choice would be memcache (the first one you listed), purely based on its correct use of nomenclature. Now here's how I came to that conclusion: Here is a quick backgrounder in naming conventions (for those unfamiliar), which explains the frustration by the question asker: For many *nix ...


20

You forgot this package: sudo yum install httpd-devel.i386 or sudo yum install httpd-devel You also might need: apt-get install apache2-threaded-dev Once it's complete, try again and at the end restart apache: sudo apachectl -k graceful


19

If you are using apache: <Directory ~ "\.svn"> Order allow,deny Deny from all </Directory> That will block people from accessing .svn directories remotely (using the browser) but you can keep then (and svn capabilities) on the project. BTW you can substitute \.svn for \.git or \.cvs if you are using something different than ...


19

Just to double check, do you have logging set to E_ALL, and display_errors enabled in your php.ini? Usually this is enough to display these errors in IIS 7. Next, take a look at your IIS settings, as it may be set to only show error messages locally. In the IIS 7 configuration editor this is under system.webServer->httpErrors. You will need to change ...


19

0) Yes. At the very least, it's a systematic probe against your site trying to discover if it's vulnerable. 1) Other than making sure that your code is clean, there's not a lot you can do but run your own tests against your host to make sure it's safe. Google Skipfish is one of the many tools to help you there. 2) I would.


18

Re: Tip 3 above (for anyone else who happens to come across this via google), it seems that at least presently in order for this to work you must use memcache.session_redundancy = N+1 for N servers in your pool, at least that seems to be the minimum threshold value that works. (Tested with php 5.3.3 on debian stable, pecl memcache 3.0.6, two memcached ...


17

If you insist on doing this (as opposed to going with @sweaves answer) then I'd start by: dropping Php, Apache, and MySql. They are not necessary and will introduce their own headaches. Get an FTPS server up and running. Along these lines you might consider dumping Windows Server 2003 in favor of 2008 R2. IIS 7 has much better FTP items built in. ...


17

Leave it as public, it'll be fine I reckon it's an ip conflict somewhere in the domain resolution, but I'm not worried about it. This guy is an idiot and this is complete nonsense. Access rights have nothing to do with IP addresess or domain resolution, he is just dropping words. Given the quality of this "administrator", I would recommend to host your ...


17

Is php 5.3 really necessary for what you're doing? Don't automatically assume newer is better. If you upgrade to CentOS 6 php 5.3 is the default. What you have to understand is RedHat (and thus its clones) is very conservative about upgrading packages with good reason. If you want the to push it and get more upgraded packages, expect problems. That said, ...


16

This is normal and expected behavior, according to RFC 2616: Applications that are at least conditionally compliant with this specification SHOULD use an HTTP-Version of "HTTP/1.1" in their messages, and MUST do so for any message that is not compatible with HTTP/1.0. For more details on when to send specific HTTP-Version values, see RFC 2145. RFC 2145 ...


16

Upgrade all packages: apt-get update; apt-get upgrade; If you want to upgrade just one package (e.g. php5): apt-get update; apt-get install php5; For the package versions available on Debian take a look at: http://www.debian.org/distrib/packages If you want to install php5 5.4.4-2, that is only available on wheezy, you should add wheezy to your ...


16

If you run out of physical memory, you use virtual memory, which stores the data in memory on disk. Reading from disk is several orders of magnitude slower than reading from memory, so this slows everything way down. (Exchanging data between real memory and virtual memory is "swapping". The space on disk is "swap space".) If your app is "using swap", ...


16

The older, buggier one is called php-memcache because that seemed the most appropriate name. The newer, better version independently developed by the folks at Digg was instead named php-memcached in the interest of disambiguation. People who would recommend you pick one over the other based solely on the correctness of the name really have no business ...


15

Use the open_basedir directive to confine your PHP scripts to their home directory and eventual extra application directories. This is very efficient by itself. Use hardened php because that costs nothing and it can help. Use suPHP to have PHP scripts execute as the owner of the file (one user per website) and avoid using files with bad permissions such as ...



Only top voted, non community-wiki answers of a minimum length are eligible