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
5answers
191 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
10k 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
2k 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
7answers
16k 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
5k 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
6answers
4k views

What is the best Linux distro for a php web server? [closed]

We are planning to upgrade our hardware and at the same time we plan to reinstall all our web server from a fresh OS. Currently our web server is running on CentOS 4.7 on a dedicated server. We are ...
4
votes
1answer
3k views

Differences and dis/advanages between: Fast-CGI, CGI, Mod-PHP, SuPHP, PHP-FPM

There are few different php "wrappers"(?). What are differences between them? Tried to google some, but cant seem to find informations. (mod-php is not googleable). Why might I choose one over ...
4
votes
1answer
9k views

why isn't laravel's php artisan serve server being accessible from the WWW on IIS

I have a laravel application running through the laravel artisan server: php artisan serve and it works just fine if I go on my localhost:8000.. Further, I added an inbound rule in the IIS server ...
4
votes
5answers
9k 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
2answers
9k views

nginx, alias, php-fpm = File not Found

I'm trying to set up nginx with DAViCal. However, I'm getting a "File not Found" with a "FastCGI sent in stderr: "Primary script unknown" in the log. Looks like something is wrong with my aliasing but ...
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
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
2answers
14k 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
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
2k 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
4answers
6k views

The requested PHP extension ext-mcrypt * is missing from your system [closed]

I have updated my php to version 5.4.13 etc and well in the terminal my version of php states this PHP 5.4.12 (cli) (built: Mar 16 2013 21:46:23) But running a composer install io get the ...
4
votes
2answers
7k 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
8k 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
11k 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
8k 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
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: ...
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
857 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
14k 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
222 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
274 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
7k views

500 error on fresh install of IIS and PHP

When attempting to run a PHP file on Windows server 2012 and IIS, I keep getting a 500 error. I cannot find any detaild logs or anything. However, when going to PHP Manager for IIS and click check ...
4
votes
1answer
2k views

How can I install phalcon (or any custom PHP module/extension) on my shared cPanel web host? [closed]

Is it possible to install phalcon (a custom PHP PECL extension/module) on a shared web hosting service that uses cPanel, or is it normally something that requires root access? That is, can I still ...
4
votes
5answers
1k views

Apache/Varnish/PHP: Just to confirm, is it possible to automatically update $_SERVER['REMOTE_ADDR'] to have the real client's IP?

I just cannot seem to get the real client IP to show in PHP's $_SERVER['REMOTE_ADDR']. It shows in $_SERVER['X_FORWARDED_FOR'], but the $_SERVER['REMOTE_ADDR'] always points to the Varnish service ...
4
votes
2answers
310 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
7k 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
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 ...