Questions tagged [php]

PHP is a general-purpose scripting language that is especially suited for Web development. The online manual is an excellent resource for the language syntax and has an extensive list of the built-in and extension functions. Most extensions can be found in PECL.

PHP is an open-source general-purpose scripting language that is suited and popular for server-side Web Development. There is an excellent online manual and a wiki. The online manual is a complete reference for syntax, built in functions, and extensions. There are lots of extensions for PHP that most of them can be find in PECL.

If you want to post a question in PHP, check the error log or if errors are enabled, enter them from output of your script if any.

7887 questions
25
votes
5 answers

Can a pool of memcache daemons be used to share sessions more efficiently?

We are moving from a 1 webserver setup to a two webserver setup and I need to start sharing PHP sessions between the two load balanced machines. We already have memcached installed (and started) and so I was pleasantly surprized that I could…
Tom
  • 4,277
  • 11
  • 42
  • 52
25
votes
2 answers

What kind of server do I need to handle 10 million requests and mySQL queries a day?

I'm a newbie of server administration and I'm looking for a powerful hosting service to host my new website. This website is basically a back-end of an mobile online game, and it will: handle up to 10 million of HTTPS request and mySQL queries a…
Calvin
  • 361
  • 1
  • 4
  • 4
24
votes
4 answers

How to automatically and temporarily block an IP address making too many hits on the server in a short timespan?

One of my LAMP servers was recently brought down by some kind of script bot looking for exploits. From the looks of it, it was making so many requests a second, that it overloaded the RAM on the server and brought my entire site down for an hour. …
ProgrammerGirl
  • 449
  • 1
  • 4
  • 8
24
votes
6 answers

Connecting to MySQL from PHP is extremely slow

I just did a fresh install of XAMPP. When first opening PHPMyAdmin I noticed it was extremely slow. It didn't make sense that on localhost it should take almost 5 seconds for every page to open. I made a small test case to shift the blame off…
Hubro
  • 1,138
  • 4
  • 16
  • 35
23
votes
1 answer

php script can't access /tmp folder

I have no open_basedir, php can access /etc /usr /proc /home etc… but not /tmp. tmpfs is mount on /tmp (/tmp type tmpfs (rw)) That's also the reason I want to use the /tmp folder. My files are owned by http (user for nginx and php) and readable by…
eephyne
  • 781
  • 1
  • 5
  • 9
23
votes
16 answers

Why is it bad to have a weak mysql user password?

I was presented with an argument to the tune of "you don't need a strong mysql user password because in order to use it, they'd already have access to your server." We're talking about a 4 digit password that is a standard english dictionary word on…
Citizen
  • 560
  • 6
  • 16
22
votes
3 answers

How do I upgrade to the latest PHP version in CentOS with yum?

I found some blog posts about this, but it's rather lack of descriptions on possible side effects. I could really use some detailed on these steps: How to add a repo that provides PHP 5.4 into yum Can this seamlessly replaces the current PHP…
Vicary
  • 333
  • 1
  • 2
  • 8
22
votes
13 answers

Mysteriously empty $_POST array

I have the following HTML/PHP page:
user254875486
  • 271
  • 1
  • 2
  • 9
21
votes
9 answers

What permissions / ownership to set on PHP Sessions Folder when running FastCGI / PHP-FPM (as user "nobody")?

I'm having trouble getting a number of scripts running because PHP-FPM can't write to my session folder: "2009/10/01 23:54:07 [error] 17830#0: *24 FastCGI sent in stderr: "PHP Warning: Unknown:…
Professor Frink
  • 529
  • 4
  • 7
  • 15
21
votes
5 answers

php mail() function painfully slow on local development machine

Background: If you have set up a local apache server for development purposes you may have run into the problem where sendmail takes a long time (at least one minute) to send emails. This is extremely frustrating if you are trying to debug a problem…
Michael B
  • 341
  • 1
  • 2
  • 9
20
votes
5 answers

How to configure PHP CLI on linux ubuntu to run as www-data?

I have a symfony2 application on my ubuntu. Symfony has a plenty of useful console commands (like php app/console cache:clear or php app/console assets:install web). The problem is If I run them as root user the newly generated files will have…
19
votes
4 answers

nginx / php-fpm error logging

I'm trying to figure out where the PHP errors are going in my setup. I'm running nginx as the reverse proxy to PHP-FPM, but I'm not seeing the various E_NOTICE or E_WARNING messages my app is producing. The only reason I know they're happening is…
Jeremy Wilson
  • 311
  • 1
  • 3
  • 12
19
votes
1 answer

How to install/enable GMP (math functions) for PHP on Ubuntu?

When calling a gmp math function like gmp_mod, I get: Fatal error: Call to undefined function gmp_mod() I have installed the php5-gmp package and restarted the web-server, and the function is still undefined. The server is running Ubuntu 10.04 and…
Nick
  • 4,503
  • 29
  • 69
  • 97
19
votes
4 answers

Failed to instal APC via pecl install APC

When I try to install APC via pecl install APC-3.1.5 or even pecl install APC I get following error when the package comes to the make command: running: make /bin/sh /var/tmp/pear-build-root/APC-3.1.5/libtool --mode=compile cc -I. -I/var/tmp/APC…
sangoku
  • 191
  • 1
  • 1
  • 3
18
votes
4 answers

How can I determine the cause of an apparent memory leak in my Apache/PHP based web app?

About once a week, but sometimes even a couple of times a day after running fine for days, my EC2 instances become unresponsive. Munin's memory graphs tell a pretty straightforward story: memory allocated to "apps" starts growing and doesn't stop…
ondrej
  • 313
  • 1
  • 2
  • 6