Hot answers tagged

138

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 /etc/init.d/php7.0-fpm restart # debian-style PHP 7 Using service wrapper script service php-fpm restart # typical service php5-fpm restart # debian-style service php7.0-fpm restart # debian-style ...


93

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 You may need to install add-apt-repository on Ubuntu 12.04. To do so, run the command: sudo apt-get install python-software-properties Other New Versions For PHP 5.5 ...


63

yes. you can clear the memcache. try: telnet localhost 11211 flush_all quit if the memcache does not run on localhost 11211, you will have to adjust it.


61

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.


55

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 ...


54

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 ...


53

First of all you should check what websites are hosted on the server # apachectl -t -D DUMP_VHOSTS Then when you will find a site check corresponding configuration file for the option DocumentRoot. For example # apachectl -t -D DUMP_VHOSTS VirtualHost configuration: wildcard NameVirtualHosts and _default_ servers: *:80 is a ...


44

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 ...


44

maybe they use tail -f on the access log?


44

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


40

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 ...


38

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 ...


36

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. ...


36

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.


36

The questions is a little bit strange, it's not clear if you're asking only for PHP or your question is more general. I will give you a brief overview from the PHP side. First, the two protocols: CGI scripts is a way how to run a server side script when a HTTP request comes; this has nothing to do with PHP FastCGI is a "better CGI" - CGI is known to be ...


34

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 ...


34

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


33

Do it from your command line: php -v mysql -V and: php -i | grep -i '^libxml' OR Put this in your root directory: <? phpinfo(); ?> Save it as phpinfo.php and point your browser to it (this could be http://localhost/phpinfo.php)


31

Since a WAMP stack itself is composed of apache, mysql and php, then what's the difference between using the WAMP stack and installing them all separately? There are many differences, though the three most troubling ones are: insecure configuration difficulty and lag in upgrades non-standard configs/binary locations To expand on #1: WAMP, MAMP, ...


30

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 ...


29

I had the same problem in Ubuntu 12.04.1 LTS and solved it with: sudo apt-get install libcurl4-openssl-dev pkg-config. After that I could compile it just using --with-openssl


28

I found the solution. Very easy, indeed. I forgot to include the following: AddType application/x-httpd-php .php into apache mod_mime section into httpd.conf I was misled by the fact that php scripts were correctly working; however the negotiation was failing because mod_negotiation only looks for "interesting" (and known) file types.


27

This is taken almost verbatim from my answer here, but I know we frown on link-only answers on SO so I imagine you guys do as well :-) If you are having this problem and using a version of Windows before Windows 7, this is probably not the answer to your problem. Why is this happening? The cause of this problem is IPv4 vs IPv6. When you use a host name ...


26

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 ...


26

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 ...


25

255 is an error, I could reproduce that same exit code by having a fatal error. This means that somehow your error reporting is hidden, there are some possible causes for this: error_reporting is not defined and php reports no error at all An @ (error suppression operator) hides the output of the error STDERR is redirected somewhere else (php -f ...


25

This will also work using netcat echo "flush_all" | nc -q 2 localhost 11211 Then just wait for the "OK".


24

There's a fairly good chance you're missing the correct VC++ runtime for the version of PHP you're running. If you're running PHP 5.5.x you need to ensure the VC++11 runtime is installed: http://www.microsoft.com/en-us/download/details.aspx?id=30679 Make sure you download and install the x86 version (vcredist_x86.exe), PHP on Windows isn't 64 bit yet. ...


23

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 ...


23

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 ...



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