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
4answers
12k views

How to build missing PHP 5.3 extensions on CentOS 5.6

I've created a fresh installation of CentOS 5.6, and installed PHP 5.3 using the php53-* packages from the CentOS repository. Specifically, I've got: php53 php53-cli php53-common php53-devel ...
4
votes
4answers
9k views

Are PHP session files ever deleted?

I see there are thousands of files in my "/tmp" directory (a CentOS machine) and almost all of them are PHP session files. I'm worried about the possible impact this might have on my system. Are those ...
4
votes
3answers
3k views

How to add Postgres support to PHP installed by Homebrew?

I have already installed and configured new version of PHP with Homebrew, including MySQL support and XDebug. That works fine. However, I need to install the support for PostgreSQL as well. How can I ...
4
votes
2answers
13k views

How do you upgrade PHP 5.1 to PHP 5.3 using yum on CentOS

Using Yum/CentOS. The problem is that php 5.1 is already installed and running so yum update php dont work! I looked around the net for a solution but they say to do the above =/
4
votes
3answers
2k views

Apache/PHP appears to be caching symbolic links for 60 seconds - how to stop it, or discover what is really caching the symlinks and stop that?

We have a PHP web application we are deploying to a LAMP server running CentOS 5.5 using Capistrano. Capistrano manages switching to the latest version (and rolling back) using a symlink, so our ...
4
votes
1answer
7k views

Nginx: Rewrite rule for subfolder

I have a subdomain where I want to keep projects I am working on, in order to show these projects to clients. Here is the configuraion file from /etc/nginx/sites-available/projects: server { ...
4
votes
3answers
1k views

Cron job creating empty file each time it runs

I have a php script I want to run every minute to see if there are draft news posts that need to be posted. I was using "wget" for the cron command in cPanel, but i noticed (after a couple days) that ...
4
votes
3answers
6k views

How to set the PHP Api Version for phpize

I'm upgrading php on my server but I'm running into a problem with phpize and compiling external modules. phpize -v reports: Configuring for: PHP Api Version: 20041225 Zend Module Api No: ...
4
votes
2answers
6k views

What to do after hitting the dreaded 256 max connections Apache Limit

After scratching my head trying to figure out why my site was responding so slowly even though the server resources are fine, I finally checked the Apache status and found: 78 requests/sec - 0.7 ...
4
votes
3answers
7k views

Isolating Apache virtualhosts from the rest of the system

I am setting up a web server that will host a number of different web sites as Apache VirtualHosts, each of these will have the possibility to run scripts (primarily PHP, possiblu others). My ...
4
votes
2answers
10k views

How can i enable byte range request?

How can i enable byte range request? While pod casting on itunes it gives an error message "There is a problem with your feed. Your episodes are hosted on a server which doesn’t support byte-range ...
4
votes
3answers
4k views

Chrome caching 302 redirects

I have a php script with is used to rotate banner images on a site. Under Firefox/IE page refreshes will make another request and a different image will be returned. Under Chrome, the request seems ...
4
votes
2answers
7k views

How to install old PHP version

I have installed php from apt -- How can I remove that version and install an older one?
4
votes
1answer
3k views

PHP_Flag and PHP_Value Command Not Found Issue

We currently have a dedicated server with one company that is running apache, php, mysql etc. It currently has whm/cpanel installed. We are migrating to a new server with cpanel/whm. Everything ...
4
votes
2answers
3k views

code injected inside PHP file with 777 permission

I woke up to find that all the folders in my shared-web-host with 777 permission had two new php file. The code inside the file could not be read - here is the decoded version: ...
4
votes
9answers
3k views

Password Self-serve Active Directory via LAMP environment

I would like to be able to change active directory passwords via a Linux/Apache based webpage. This would be a self serve web page for the user. I have SSL-LDAP setup on the Active Directory to make ...
4
votes
3answers
5k views

How can I rewrite urls (ala mod_rewrite) for free in IIS 6?

I've got an application I wrote (with cakephp) for the lamp stack and I'm moving it to a windows server. I'm having a lot of trouble with apache for windows (memory and cpu issues) so I would like to ...
4
votes
2answers
3k views

Sendmail chdir(/clientmqueue) permission denied

My centos server can send mail using the 'mail' command but not from php. Maillog says: sendmail[18010]: NOQUEUE: SYSERR(nginx): can not chdir(/var/spool/clientmqueue/): Permission denied My ...
4
votes
1answer
785 views

How to maintain PCI compliance on a LAMP server when repositories don't keep up with versions

We run Ubuntu Lucid 10.0.4 as the foundation of our LAMP environment. We are trying to become PCI compliant so that we can pass CC info through our server. We have run some third-party scans on our ...
4
votes
2answers
13k views

How to upgrade to latest PHP, MySQL, and phpmyadmin on CentOS 5.8 (32bit)?

I have searched around on the internet and cannot find a reliable source for installing the latest versions of PHP, MySQL, and phpmyadmin on CentOS 5.8 32bit with apache. I have tried a couple times, ...
4
votes
5answers
4k views

PHP broken after upgrading to php 5.4

on an ubuntu 12.04 i have upgraded to PHP 5.4 according to this tutorial http://www.upubuntu.com/2012/03/how-to-upgrade-install-php-540-under.html But when i call php5 -v i get PHP Warning: PHP ...
4
votes
1answer
220 views

What exactly does SuPHP do?

And is it necessary? I've read a bunch of pages on it and I can't for the life of me actually figure it out, as opposed to what apache and just plain old php already do.
4
votes
3answers
263 views

Proper permissions for two developer team on PHP5 Apache Linux server

I was hoping someone could point me in the right direction regarding Linux permissions. I understand how to calculate what permissions are, understand the methodology behind changing them and can ...
4
votes
1answer
1k views

How can I install a custom (patched) PECL extension?

I'm trying to use the htscanner PECL extension on my CentOS 5/PHP 5.2.6 machine, but there's a bug in the latest version where a newline character is added to the end of every php_value directive. ...
4
votes
2answers
8k views

what chmod and owner:group settings are best for a web application?

we are configuring a PHP web application on CentOS and have all our files currently in /var/www/html/project/ Apache is configured to run as apache:apache and has access to the directory above. Right ...
4
votes
2answers
308 views

Hardened PHP deployment on Ubuntu

I've been asked to create a PHP environment on a web-server I administer that is currently only running Python applications. The authors of these applications don't necessarily have a programming ...
4
votes
2answers
296 views

How To Deal With Frequent And Constant PHP/MySQL Version Updates

The Problem: I know that many people are not so happy about frequent version changes. Especially when latest version of PHP or MySQL that you are stick to is no longer available in your repository ...
4
votes
3answers
5k views

What is the easiest way to setup a linux server to send mail?

I'm just about finished setting up the basics of my new ubuntu server - I don't have very much experience with Linux. I only need to be able to send email from my server - but it seems to be really ...
4
votes
2answers
2k views

Change php modules directory

I am compiling php, and its setting my modules directory to /usr/lib64/20090626-zts I would like to change this to /usr/lib64/php/modules, but I cannot find a configuration option to do so. I can ...
4
votes
3answers
6k views

Apache2: 400 Bad Request with Rewrite Rules, nothing in error log?

This is driving me nuts. Background: I'm using the built-in Apache2 & PHP that comes with Mac OS X 10.6 I have a vhost setup as follows: NameVirtualHost *:81 <Directory ...
4
votes
1answer
5k views

How to configure nginx+php (fcgi) to run every subdomain with a different user?

Im pretty new to nginx and - more for learning purpose - im trying to configure Nginx in order to run php with a different user for every subdomains. For example, i would like to use user john for ...
4
votes
3answers
7k views

run shell command as other user called by PHP

I have a PHP script which is called by HTTP and not as command line script. This script should call a shell command as an other user than the current webserver user www-data. Example: <?php echo ...
4
votes
9answers
3k views

How can I test the security of my server?

How can I test the security of my server ? Please I know it is too general question. But I was wondering if there is a tester software or web service checking all ports of your server, or possibly ...
4
votes
5answers
4k 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
2answers
8k views

Enable PUT method on apache for any php script

I would like to enable the PUT and DELETE methods to any .php script on my Apache web server. Currently I only have this answer : The requested method PUT is not allowed for the URL ...
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
159 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
3answers
3k views

Dynamic nginx domain root path based on hostname?

I am trying to setup my development nginx/PHP server with a basic master/catch-all vhost config so that I can created unlimited ___.framework.loc domains as needed. server { listen 80; ...
4
votes
1answer
6k views

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 ...
4
votes
1answer
5k views

How to log outgoing http requests from PHP + cURL?

I have a PHP script set up that makes cURL requests whenever an action is performed on a site. The problem is that the information is being POSTed twice whenever the action is run. I need to work ...
4
votes
2answers
846 views

“su _www helloworld.php” does nothing

In the context of a larger effort, I've run across a particular issue that is baffling me. On Mac OS X 10.6.7, using the system provided Apache and PHP, I have created a simple HelloWorld.php script ...
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
5k 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
7k 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
106 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
1answer
456 views

Nginx - Enable PHP for all hosts

I am currently testing out nginx and have set up some virtual hosts by putting configurations for each virtual host in its own file in a folder called sites-enabled. I then ask nginx to load all ...
4
votes
2answers
266 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
787 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
2answers
196 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 ...