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

5
votes
5answers
916 views

One Wordpress install (multisite) or multiple installs?

I manage a server for a client who has several Wordpress blogs. They all precariously balance on PHP/FastCGI/nginx and it all works at the moment, just using a little more RAM than I'd normally be ...
5
votes
1answer
3k views

How do you run a PHP script as the file's owner, rather than as the webserver user?

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 (eg) www-data? ...
5
votes
3answers
469 views

Is my webserver allowing pre-fetching?

I have an image based website that hosts multiple galleries. When a user clicks one of the images the views property for the particular image is incremented. However, I noticed when using Firefox ...
5
votes
2answers
4k 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 ...
5
votes
1answer
720 views

Looking for specifics about how PHP session garbage collection works

PHP has several session settings that control the probability that garbage collection (i.e. deletion of expired sessions) will occur. My question is: does this probability apply to all running Apache ...
5
votes
1answer
2k views

Advice for Debugging Apache with PHP Segmentation Faults

Every hour or so an Apache child process seg. faults on our web server. We are running a non-threaded PHP 5.2.17 Apache module with Apache prefork MPM. I have run httpd with a few core dumps, gdb and ...
5
votes
1answer
6k views

Enabling APC causes internal server error

After installing and enabling APC 3.1.9 (Alternate PHP Cache), using pecl, i ran into an internal server error. I checked my error logs, and this is what shows up. Error Logs: PHP Fatal error: PHP ...
5
votes
2answers
2k views

V8js PHP module on Linux - can't find libv8.so

Running into a problem with v8js-0.1.2 (beta) - I'm seeing others have success on the net but regardless of what platform/OS I'm running, I always hit the same problem. I'm currently attempting to ...
5
votes
2answers
86 views

Server recommendation for simple script

I have a simple 2kb PHP script that I want to host on my own domain. Soon, i'll connect it to a mySQL database and add Google Analytics. But thats pretty much it. There is no physical content or even ...
5
votes
4answers
2k views

can't get php mail() working on Ubuntu desktop version with sendmail and postfix

I'm running Ubuntu 9.10 LAMP and trying to do a simple email test with PHP and I'm not getting any emails sent. mail("myemail@gmail.com", "eric-linux test", "test") or die("can't send mail"); I ...
5
votes
1answer
6k views

Cacti graph not showing

I have created php script for cacti which outputs data in format like: <variable>:<value> Output of my script: temperature:20 humidity:15 Then I created data input method where input ...
5
votes
3answers
1k views

PHP APC Accelerator completely breaks Apache2 on Windows?

My local development configuration: Apache 2.2.21 VC9 downloaded from Apache Lounge (as suggested at PHP For Windows website. Manual installation as service. PHP 5.3.8 VC9 x86 Thread Safe, installed ...
5
votes
1answer
2k views

Installing a php extension (xdiff) from pecl on Linux

I was getting this error on my php script: Fatal error: Call to undefined function xdiff_file_diff() I realised that I didn't had the xdiff extension installed. When I tried to install it using the ...
5
votes
3answers
16k views

How do I configure IIS to allow access to network resources for PHP scripts?

I am currently working on a PHP front-end that joins together a series of applications running on separate servers; many of these applications generate files that I need access to, but these files ...
5
votes
1answer
151 views

Odd performance fluctation with php-fpm and nginx

I'm running a load test against a web service. It's a php application running on php-fpm and nginx, with fastcgi. There is a MySQL backend being used for small reads only. Invariably, I'm seeing a ...
5
votes
0answers
162 views

SPDY & Nginx upload issues

I have this setting: an Nginx server with php-fpm and the http://blueimp.github.io/jQuery-File-Upload/ When I try to upload a file after about 10MB it fails. This happens when SPDY is activated. ...
5
votes
3answers
300 views

freebsd does not recognise that php was installed via ports

I have php 5.2.12 installed on FreeBSD 8.0-STABLE. It was installed from ports and I am trying to upgrade it to 5.3.2. However for some reason my system is not recognising that php was installed via ...
4
votes
9answers
778 views

Wordpress on AS/400

My client needs one clarification before assigning a job. Is it possible to run Wordpress on AS/400? Thanks
4
votes
2answers
3k views

Nginx ignoring client's HTTP 1.0 request and respond by HTTP 1.1

I am testing using nginx/php5-fpm, with the code <?php header($_SERVER["SERVER_PROTOCOL"]." 404 Not Found"); // also tested: header("Status: 404 Not Found"); echo $_SERVER["SERVER_PROTOCOL"]; ...
4
votes
8answers
9k views

How to determine which PHP is being used?

How to determine which PHP is being used? For example, if there are /usr/local/bin/php and usr/local/bin/php5, how do I know which one is being used by my PHP scripts?
4
votes
5answers
192 views

What statistics app should I use for my website?

I have my own server (with root access). I need statistics of users who visit my website etc etc... I have looked at an app called Webalyzer... Is this a good choice? I run apache2 on a Ubuntu 9 ...
4
votes
3answers
12k views

PHP: Serve a file for download without providing the direct link

I want to serve invoices for download. Currently I'm using a simple numbering scheme (invoice-01.pdf, invoice-02.pdf, and so on). I know that I could use hashes instead to obscure the data. Is it ...
4
votes
2answers
3k views

The Content-Length header does not exist

I have nginx server installed on Linux. When I send a request with curl, the Content-Length header is missing from the response. The 1.php file is: <?php echo "hello"; ?> The example ...
4
votes
6answers
7k views

Apache, nginx, or lighttpd? [closed]

I am going to be live blogging from an event and expect huge spikes in traffic. I am currently using apache with modphp and it died last year under heavy traffic and I don't want it to happen again. ...
4
votes
7answers
17k views

Mac OS Snow Leopard: Why does my mysql.default_socket value not change in my phpinfo() page?

I'm getting errors whenever I try to connect locally to mySQL on Mac OS Snow Leopard 10.6.4. I'm running mySQL 5.1.46. I can log in using the console. I'm running PHP 5.3.2 and my phpinfo() page is ...
4
votes
5answers
6k views

Is LDAP the only way to authenticate an web application against Active Directory?

I'm a PHP programmer and I've never work with active directory or ldap. I need to integrate my web app with an active directory and after ask the IT guy of the client company he said to me that isn't ...
4
votes
1answer
3k views

How to add directives to php.ini on AWS Elastic Beanstalk?

I'd like to add these PHP settings to my Elastic Beanstalk environment: upload_max_filesize = 64M post_max_size = 64M These options cannot be set with option_settings in .ebextensions: Namespace ...
4
votes
6answers
10k views

What causes PHP pages to consistently download instead of running normally

I'm running a Ubuntu Server on a VM, to test out different web forum solutions. I have set up a ~/public_html/ to be accessible with the apache2 web server, and that works fine. However when I go to ...
4
votes
3answers
14k views

Installing PCNTL module for PHP without recompiling

Is it possible to install the pcntl module without recompiling php? I'm trying to set this up on CentOS.
4
votes
4answers
6k views

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 ...
4
votes
4answers
13k 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
10k 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
9k 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
8answers
1k views

Redirect all incoming mail into a script

I have no idea about Mail Delivery. but i need redirect ALL incoming e-mail (*@mydomain.com) into an a php script. i'm using debian Exists a simple mail server to do this? (without exim, postfix, ...
4
votes
3answers
5k 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
15k 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
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
1answer
8k 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
7k 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
3k views

PHP install on clean Amazon Linux AMI

I'm trying to get a script working to bring up new Amazon Linux EC2 instances with php55 and the Amazon PHP sdk. However, I'm running into a problem that I think is caused by PHP version conflicts. I ...
4
votes
1answer
3k views

My nginx rewrite is downloading the php file

I have the following rewrite rule I'm trying: location / { index index.php index.html; rewrite ^/test$ /test.php break; } And I ...
4
votes
2answers
9k 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
1answer
1k 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
12k 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
1answer
8k views

Curl POST - 411 Length Required

We have a RestFUL API we build in PHP. If we make the request: curl -u api-key:api-passphrase https://api.domain.com/v1/product -X POST We get back: 411 - Length Required Though if we simply add ...
4
votes
4answers
4k views

Running PHPmyAdmin on Nginx, port 8080 passed to varnish not working well!

I installed Nginx, Varnish and PHP-fpm. Then I installed PHPmyAdmin and made a virtual host for it: server{ listen 8080; server_name phpmyadmin.Domain.com; access_log ...
4
votes
5answers
4k views

Where's my memory?! Nginx + PHP-FPM front end webserver slows to a crawl

I'm not sure if I have a problem with a memory leak (as my hosting company suggests), or if we both need to read http://linuxatemyram.com. Maybe you clever people can help us out? This is a front-end ...
4
votes
3answers
5k views

Nginx - Route all requests to single script

I have a PHP script that handles script routing and does all sorts of fancy things. It was originally designed for Apache, but I'm trying to migrate it to nginx for a few of my boxes. Right now, I'm ...
4
votes
2answers
4k 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: ...