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.

learn more… | top users | synonyms

4
votes
3answers
9k views

PHP: what is --enable-zend-multibyte configure option for?

What is exactly --enable-zend-multibyte option for when you ./configure PHP?
4
votes
3answers
4k views

PHP 5.2x on Ubuntu 10.04 Lucid Lynx

It appears that Lucid Lynx comes with PHP 5.3. Is there a convenient way to downgrade to the latest 5.2x release?
4
votes
1answer
5k views

PHP mail() not working with Postfix on Ubuntu

I recently purchased a VPS plan. I installed Ubuntu 9.10, PHP5 and Postfix. I can't get the PHP mail() function to work. In my PHP script, the mail() function returns true, which suggests it is ...
4
votes
3answers
156 views

What's a good resource for learning about scaling PHP applications?

I know PHP fairly well. But one aspect of PHP which I am fairly green in is caching, loading balancing etc. A lot of companies hiring PHP developers are looking for these high-use background, which ...
4
votes
2answers
3k views

How do I make all URLs run through a single PHP file?

How do MVC systems where the urls are in these forms force all the requests through a single index.php file? http://www.example.com/foo/bar/baz ...
4
votes
3answers
5k views

Php5-fpm Crash if much visitors

I decided to change my OP to Nginx from Litespeed because i read much about the low resource that Nginx would cost. Im running a Wordpress site with 500 users online Okay thanks Guys for that much ...
4
votes
4answers
3k views

Running git pull from a php script

I was trying the Perfect Workflow, with Git, GitHub, and SSH, but it seems i can't run git pull. I've tried git status and it's fine. When i git pull 2>&1 i get: error: cannot open ...
4
votes
2answers
2k views

php pear: The default config file is not a valid config file or is corrupted

I'm really in deep sh*t here. While running "pear install HTTP", my server get rebooted, when everything back, I continue my work, and... $sudo pear install HTTP ERROR: The default config file is not ...
4
votes
3answers
4k views

Why is PHP $_REQUEST array empty?

I installed nginx on Ubuntu Hardy and immediately realized that the PHP scripts were getting empty request arrays, ie whether GET or POST nothing was coming through, even the $_REQUEST array was ...
4
votes
3answers
6k views

Can Nginx handle php (or similar fcgi) requests inside of an alias?

I am converting a legacy Apache server to Nginx and do not have the luxury of changing URL's or rearranging the filesystem. Is it possible to use nested location{} blocks in the Nginx configuration ...
4
votes
1answer
54 views

“Couldn't resolve host” for any external content

On our site we run a few different scripts for various sites (uploading to amazon s3, data from chartbeat, script to count twitter followers) and all of them just stop working from time to time. They ...
4
votes
2answers
205 views

signal Segmentation fault after specific url access

In my PHP program when I access specific URL (POST some data) the request has been aborted and this logs appear in Apache error.log: WARNING: HOME is not set, using root: / [Thu Sep 13 22:49:47 ...
4
votes
1answer
619 views

Strace Apache process output showing 24 seconds wait?What can be the reason?

Performed strace on one one of the apache children and its showing 24 seconds between two system calls.How can i determine what is the cause of this behavior.It looks like both children are taking ...
4
votes
1answer
305 views

PHP is slower than it should be

I have a server with Dual Xeon Quad Core L5420 running at 2.5GHz. I've been optimizing my server, and have come to my final bottleneck: PHP. My very simple PHP script: ./test.php <?php ...
4
votes
2answers
296 views

Installing PHP on linux

I'm trying to setup php with oci8 support. I think I've configured all correctly before starting with oci, here is how I tried to start the install : ./configure -prefix=/common_share/APACHE/server ...
4
votes
1answer
488 views

What am I (a beginner) losing, by choosing Cherokee over Apache for serving dynamic content?

I am a complete beginner and am planning to setup a photo sharing site. This is the setup I am planning, basically for a start - - Cherokee (instead of Apache) for serving dynamic content ...
4
votes
3answers
9k views

How do I get PHP 5.3 working on Red Hat Enterprise Linux, with PDO enabled? PHP53 was installed with yum

This problem is complicated, and I'm not an expert at all, so bear with me. My server admin team set me up with a standard RHEL box. It had PHP preinstalled, as well as apache. I am now trying to ...
4
votes
2answers
161 views

Recompiled PHP, now Apache not parsing PHP files

I recompiled PHP earlier today, now when you access PHP pages in a browser, Apache displays its source code instead of parsing it. Do I need to reset some configuration or recompile Apache? This is ...
4
votes
3answers
1k views

Is there a safer way to stop mysql(d)?

I'm running very hard php script on my cheap virtual machine, which has about half million page views a week so it's a bit problematic. I restart my mysql twice a day. That wouldn't be problem, but ...
4
votes
5answers
3k views

Adding PNG & JPG support to ImageMagick in PHP on CentOS

I have installed the ImageMagick extension for PHP on CentOS, but it does not have support for PNG or JPG, how do I add support for these file types to ImageMagick?
4
votes
3answers
5k views

How to use FastCGI globally and Basic Auth in sublocations in nginx?

I recently deployed my first nginx setup and everything works really nice, except the location parsing is driving me nuts. I have a simple php fastcgi setup like this: location ~ \.php { if (!-e ...
4
votes
5answers
10k views

show php error message on IIS 7

I am using IIS as a webserver on my development machine for PHP webdevelopment. Or at least, I am trying to. When there is a syntax error in a PHP script and I open that file in my webbrowser, I ...
4
votes
3answers
634 views

Upgrade PHP to latest version on CentOS 4.5

I'm a Linux newbie but I need to upgrade PHP on CentOS 4.5 to the latest version -- or at least 5.2.2 or better. What's the easiest way to do that? The latest available via yum seems to be 5.1.6 and I ...
4
votes
1answer
265 views

“No space left on device” error when writing certain session filenames

I have some filenames (session files) that can't be written ("No space left on device"). Other filenames (same directory) are fine. Disk is not full. The filesystem is ext3 PHP is giving an error ...
4
votes
2answers
491 views

Can varnish cache files without specific extension or residing in specific directory

I have a varnish installation to cache (MANY) images that my service serves. It is about 200 images of around 4k per second and varnish happily serves them according to the following rule: if ...
4
votes
2answers
170 views

text compression in postfix

I'm having the following arrangement. One server compiling emails in php and another server which run postfix (thus I have network latencies). Each email is about 300Kb and so as to send an email ...
4
votes
1answer
3k views

PHP/APC fatal error, apc_mmap: mmap failed

I'm seeing some intermittent CPU usage spikes to 100%, sort of correlated to these log entries: [27-Feb-2012 13:29:29] PHP Fatal error: PHP Startup: apc_mmap: mmap failed: in Unknown on line 0 ...
4
votes
1answer
148 views

making sure daemons are safe

So I was wondering, what steps should we take to make sure PHP daemons are safe? One of the things that I read about was assigning the daemon to run as a user with limited priveleges? But how can we ...
4
votes
4answers
2k views

PHP fopen always fails with permission denied

I am in the process of migrating a couple of Wordpress blogs over to AWS and have run into an issue with file permissions that has successfully foiled me for the last couple of hours. The simplest ...
4
votes
3answers
859 views

Why does my cron job create a log with a trailing question mark?

I have the following cron job: */5 8-20 * * * php /var/www/user/cron_email.php >> /var/www/log/log.txt It creates the following file: david@ubuntu:/var/www/log$ ls -l -rw-r--r-- 1 root root ...
4
votes
2answers
121 views

Upgrade PHP v5.3.3 to v5.3.4

I currently have PHP v5.3.3 installed and configured. Everything is working perfectly, but I would like to keep PHP up to date and upgrade to v5.3.4. Can someone please describe the usual upgrade ...
4
votes
2answers
1k views

Comparing Nginx+PHP-FPM to Apache-mod_php

I'm running Drupal and trying to figure out the best stack to serve it. Apache + mod_php or Nginx + PHP-FPM I used ApacheBench (ab) and Siege to test both setups and I'm seeing Apache performing ...
4
votes
4answers
4k views

How to secure a directory in Apache using a PHP session

I have a site that uses PHP session for authentication. There is one directory that I would like to restrict access to that does not use any PHP, it's just full of static content. I just don't know ...
4
votes
1answer
1k views

Where to set “PHP_FCGI_MAX_REQUESTS” (lighttpd)

I want to setup the max requests to keep my system RAM from filling up when there is a memory leak. But I dont know where it is.
4
votes
1answer
2k views

How do you run a PHP script as the owner?

I'm sure there's a well-known answer for this, but I can't seem to find it. How do I make a user's PHP scripts (in ~user/public_html, for example), run as the owner rather than as www-data ? Assume ...
4
votes
1answer
6k views

nginx yet another rewrite or internal redirection cycle

Yet another redirection cycle, yes. Have looked at other questions, but just can't seem to get it to work. server { listen 80; server_name localhost; charset utf-8; ...
4
votes
1answer
347 views

How does php know what memcached node to look for its data in?

I am new to the world of Memcached clusters If I have a php web application that is using memcache - how does it does its hash and decide what node to check for a particular value to avoid having to ...
4
votes
1answer
448 views

Why isn't htaccess following this php_value directive?

In .htaccess I've added php_value session.name "SID" This seems to have no effect, however, and no errors are thrown in error_log. Other rewrite rules in the same .htaccess file are working as ...
4
votes
2answers
3k views

Hung Processes in Apache?

I'm running Apache 2.2.21 with the MPM prefork on a dedicated server. More details: Server Version: Apache/2.2.21 (Unix) mod_ssl/2.2.21 OpenSSL/1.0.0-fips DAV/2 SVN/1.7.0 mod_python/3.3.1 ...
4
votes
3answers
176 views

Can't get PHP to stop showing errors

Contrary to most people's problem I cannot get PHP to stop showing errors, I have in my php.ini display_errors set to off but it still shows them, I have also tried .htaccess, and inline ini_set and ...
4
votes
4answers
568 views

Apache LAMP permisson issues on Ubuntu server

I have been trawling the internet for a few days now and think I've tried almost everything to get some virtual hosts set up on my Ubuntu server but everything short of chmod 777 on the webroot fails. ...
4
votes
2answers
675 views

How to create mysql database backup file of every day to day update?

Imagine, I am building a web application of a Bank. Therefore I need to backup the database at least once a day and to backup the whole database everyday does not sound efficient. So I want to know ...
4
votes
4answers
2k views

How do I protect large file downloads through PHP and/or Apache?

We have some large files (1-8GB) that are not publicly accessible. Currently we're serving them up through a PHP script that buffers the files in 1MB chunks and writes it to the output. It's ...
4
votes
4answers
2k views

Do I have to recompile php to enable GD Library?

I have a GD library on my server installed and 'enabled' but under the Configure Command in php.info it says "--without-gd" Is there a way to enable it through root or do I have to recompile? ...
4
votes
3answers
2k views

Centralizing PHP error logging with syslog

I have a PHP application that is running on 20 web servers. It's silly to check every servers' PHP error log. I'm planning to centralize the error logging on one (not a web server, a server just used ...
4
votes
5answers
2k views

Find which pages cause load?

I'm not normally a sysadmin, but I've got a production server under heavy load (serving some basic php pages, and some php redirect files that have some sql queries, and no images) that keeps ...
4
votes
2answers
2k views

“The server closed the connection without sending any data”

Server setup The problem Diagnostic information What I've tried Specific Help needed 1. I have the following server setup: (Running in a VM using Hyper-V) Debian Squeeze Linux 2.6.32-5-amd64 ...
4
votes
1answer
388 views

PHP Apache XAMPP Run Multiple Scripts from CLI in Background

How can I simultaneously run dozens of PHP scripts in the background from XAMPP's command line interface? Someone suggested a batch file, but when I tried executing this: start php 1.php start php ...
4
votes
1answer
535 views

Apache + PHP-FPM = random “Error parsing script headers” + Seg Faults

I have PHP-FPM setup with Apache 2.4 using proxy_fcgi, all works fine, but every one in 4-6 requests, Apache returns a blank page. This happens on my main site http://danielhe.com/, but not subdomain ...
4
votes
1answer
887 views

Apache doesn't immediately notice a change in the document root

We use capistrano for website deployments and our Apache document root is a symlink to a particular code release. The deployment procedure switches the symlink from the old release to the new release ...