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

9
votes
2answers
329 views

MediaWiki slow save of edited pages

I have MediaWiki 1.16.2 on a the following LAMP platform, which performs quite good for other apps on a 16 GB RAM dual processor machine: CentOS 5.7 (64-bit) Apache 2.2.3 MySQL 5.0.77 PHP 5.1.6 It ...
8
votes
3answers
540 views

My server Admin wants me to set public write permissions on a directory

I'm relatively new to web development, so please be patient. I'm primarily an iPhone developer, but have recently done a site for someone else using shared hosting. I could write to files in PHP on ...
8
votes
5answers
1k views

Safe to have /.svn/ folders on live site? (How to remove them but retain svn update capability?)

I'm doing svn update to update the code for my php website, but it leaves .svn/ folders all over. I think its dangerous to leave those files publically readable, but its very easy to update the ...
8
votes
3answers
15k views

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 ...
8
votes
3answers
7k views

How to Upgrade PHP to 5.4.10 on CentOS 6.3

# cat /etc/redhat-release CentOS release 6.3 (Final) # php -v PHP 5.3.3 # yum update php No Packages marked for Update How do I upgrade to the latest version PHP 5.4.10 (Current stable) ?
8
votes
2answers
297 views

My server setup for a heavily used API

I will soon be buying a bunch of servers for an application that I am about to launch but I have concerns about my setup. I appreciate any feedback I get. I have an application which will make use of ...
8
votes
2answers
22k views

Install php extensions on ubuntu

I have a Ubuntu 9.10 server. I have installed apache2 and php5 using the apt-get commands. How does one install php extensions? Are there commands like apt-get to get them? Or should I manually look ...
8
votes
4answers
7k views

How do I tell Apache which PHP to use?

I am running Apache2 on a Mac OS X (10.5). I just compiled PHP 5.2.8 and finally got pdo-mysql working (or so I think). My command line "php --version" is showing 5.2.8 and I have the right modules ...
8
votes
2answers
15k views

PHP exit status 255: what does it mean?

I recently compiled a php 5.2.9 binary, and I tried to execute some php scripts with it. I can execute some scripts without problems, but one of them halts its execution midway, exiting with no errors ...
8
votes
1answer
17k views

What is the name and location of the Nginx config file (htaccess equivalent)?

There are many tutorials on how to write Nginx rewrite rules to mimic Apache's .htaccess file but I can't confidently say I know what the name or location of this so-called Nginx config file actually ...
8
votes
1answer
3k views

apache on centos 5.6 gives me permissions denied error

I'm running apache on centos 5.6 and whenever i try to load a php script in any directory, other than /var/www/html (the apache default root dir) it gives me a permissions denied error. However when ...
8
votes
1answer
990 views

PHP on command line displays “Out of Memory”, no file name, line number or memory value

I originally posted this at http://stackoverflow.com/questions/9665189/php-on-command-line-displays-out-of-memory but was advised to post here instead. This is not the normal fatal error when you run ...
8
votes
2answers
11k views

Apache error log with PHP errors

I just set up PHP and Apache and would like to find where the errors are going. What is the default path of the error logs in apache for PHP?
8
votes
6answers
502 views

How to grow from single server setup

I'm looking for resources on how to grow our server setup. We currently have one dedicated server with Rackspace in the UK of the following spec: HPDL385_G2_PrevGen HP Single Dual Core Opteron 2214 ...
8
votes
5answers
11k views

PHP on Linux: How to make PHP use proxy settings to connect to internet?

my server is in a LAN and is connected to internet through a Proxy Server. my PHP application (Drupal), should be able to check for updates through PHP codes. how can i set Proxy Settings for PHP so ...
8
votes
1answer
4k views

Why does Cacti keep waiting for dead poller processes?

I am currently setting up a new Debian (6.0.5) server. I put Cacti (0.8.7g) on it yesterday and have been battling with it ever since. Initial issue The initial issue I was observing, was that my ...
7
votes
3answers
28k views

How to check my PHP and MySQL version on Ubuntu VPS?

HI I am going to install MyBB but I am not sure whether I have installed the correct version of PHP and MySQL. PHP version 5.1.0 or above with XML Extension installed MySQL version 4.0 or ...
7
votes
7answers
5k views

Very simple SMTP server for Ubuntu wanted

I'm looking for a very simple, lightweight SMTP server to run on an Ubuntu 9.04 VPS. The only functionality I need is to support the PHP mail command; <?php mail('caffeinated@example.com', 'My ...
7
votes
4answers
18k views

Installing PHP 5.3 on Ubuntu server

Quite simply, what is the easiest and most stable way to replace an apt-get installed PHP 5.2 with the new PHP 5.3 on an Ubuntu 8.10 server?
7
votes
4answers
16k views

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: ...
7
votes
7answers
24k views

How to configure php.ini with remote SMTP?

How do I configure PHP to send mail using mail() via a remote SMTP server? I've tried to do this using php.ini but it seems that you can only do that under Windows32 and I want to do this on my Unix ...
7
votes
2answers
7k views

Is mounting S3 buckets directly into EC2 instances safe?

as the title of my question says, I would like to know whether this is a good practice or not, I know I can mount it in an EC2 instance but I was wondering if, as I will be adding more instances to ...
7
votes
6answers
2k views

How can I keep Apache from falling over?

I have a pair of servers hosting a single Magento ecommerce site with moderate traffic (60k page views per day reported from google analytics, I think about 80k reported on the server itself). The ...
7
votes
2answers
1k views

Why does Debian clean php sessions with a cron job instead of using php's built-in garbage collector?

Debian and derivatives (Ubuntu) don't use the php session garbage collector session.gc_probability = 0 instead they use a cron /etc/cron.d/php5 09,39 * * * * root [ -x /usr/lib/php5/maxlifetime ] ...
7
votes
2answers
2k views

Error When Installing PHP5 on IIS6

I am trying to install PHP on my Windows Server 2003 machine that is using IIS6. I followed this guide for installing it, including using the binaries of fastCGI. I think I did everything correctly, ...
7
votes
5answers
12k views

PHP 5.3.1 Undefined Symbol: OnUpdateLong error on Apache Startup

I'm running Ubuntu 8.04 on this server. I had PHP 5.2 installed via the package manager. I removed it to install PHP 5.3.1 by hand. I built the packages like so ./configure --prefix=/opt/php ...
7
votes
1answer
3k views

Apache restart needed for PHP to re-read php.ini?

Does PHP read php.ini on each request or do I have to restart Apache for php to be aware of changes on php.ini?
7
votes
3answers
8k views

Change default from address from Postfix from www-data to something else

Setting up Postfix and Apache/PHP on an Ubuntu server. Mail's now going out ok with the proper domain name, but the local part display name is always "www-data" as I'm assuming Postfix uses the name ...
7
votes
1answer
1k views

Security risks of having public phpinfo() page?

I have a publicly accessible page which just has <?php phpinfo(); > I use it for debugging purposes while we're in beta, but is there any harm in leaving it accessible when its a live site?
7
votes
2answers
2k views

uploading files greater than 1MB = connection resets

I'm using nginx on the frontend as "proxy cache" and apache on the backend, i've set my PHP settings to the following: error_log = /var/www/site1/php_error.log error_reporting = 22527 file_uploads = ...
7
votes
1answer
349 views

Is there any good reason not to increase upload_max_filesize and post_max_size?

As the sysadmin of a LAMP box I am being asked to raise the upload capacity of php/html forms to something around 70 MB. I believe the server can handle it since it has two quad cores and 4 Gig RAM. I ...
7
votes
1answer
427 views

How can I use SELinux to confine PHP scripts?

I want to compartmentalize different PHP applications on my SL6.4 (RHEL 6.4 rebuild) web server so that they cannot access each others' data. It seems that SELinux might be able to do this, but I am ...
7
votes
3answers
2k views

linux: one apache two php versions. possible?

it seems that some of my php applications require php 5.2 and some require php 5.3. is there a way to configure apache (v2.2.14) that one virtualhost will work with one php library and a different ...
7
votes
1answer
1k views

Why so many gettimeofday calls?

Why does the PHP/Apache combo do so many gettimeofday syscalls? Even though the're quick every call is a call which should be accounted for. Just a quick strace -c -p [apache2 process id], gives the ...
7
votes
1answer
7k views

How should I tune apache when I see high CPU, but low memory usage?

My CentOS web nodes (LAMP stack) are experiencing high CPU usage but low memory usage. Nearly all of the processes are apache. I know I could just add additional web nodes until my cpu usage becomes ...
7
votes
3answers
749 views

mysql “Too many connections” killed the network?

So I'm pretty confused here, figured I'd throw this out here and see if anyone else has any good ideas. We suffered a pretty big outage two nights ago, and I'm still searching for the root cause. I ...
6
votes
9answers
948 views

Successfully, permanently ban a user from a website? [closed]

I have a social networking website and I want to ban a user from the website. I've added his IP address to the ban list in the .htacess file and to the php level for banning that user, but he keeps ...
6
votes
6answers
18k views

What is swap memory?

I am using RAM for storing some of my database tables and the others are stored in hard disk. Today I came to know that my processes are using swap memory. Now what is swap memory and how can I ...
6
votes
3answers
14k views

How to setup Memcached/APC on Ubuntu Server 10.04 for PHP?

I will be soon setting up Simple Machines forum on a fresh Ubuntu Server 10.04 VPS. The forum software is written in PHP. I will using Nginx as the web server, and I will be following a guide to ...
6
votes
2answers
9k views

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

I'm a new bie 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 ...
6
votes
3answers
7k views

Why are outdated packages installed by yum on CentOS? (specifically PHP 5.1) How to fix?

I'm working on a fresh CentOS server and am extremely annoyed to find out that yum does not work as smoothly and brilliantly as "apt-get install" does on Ubuntu. Installing a LAMP stack, I ran the ...
6
votes
6answers
842 views

How should I set up protection for the database against sql injection when all the php scripts are flawed?

I've inherited a php web app that is very insecure, with a history of sql injection. I can't fix the scripts immediately, I rather need them to be running to have the website running, and there are ...
6
votes
6answers
410 views

Beginners security question

I'm still pretty new to web development, and have a question about security. Every day I look at the "Latest Visitors" in my CPanel, and today there were some strange entries (one is pasted below). ...
6
votes
2answers
4k views

AWS RDS connection count

I am using AWS RDS with MySQL for a project and have a "large" instance. The documentation is clear on what this means as far as compute resources and RAM goes, but I can't find anything that ...
6
votes
5answers
4k views

Find the php script thats sending mails

Is there any way for me to find the php script that is sending emails. I have apache+php ( no mod_suphp neither suexec ) in a "standard" install, and i want to find out witch php script is sending ...
6
votes
5answers
23k views

Temporary failure in name resolution : Host name lookup failure

I've got a script in PHP that's been running fine for months. It recently stopped working. This script connects to gmail to send out an email to my customers. Recently, I started getting this error ...
6
votes
4answers
773 views

Any security tips for my first server? (complete beginner)

I'm paying for a VPS and hoping to launch my first website on it in the next few days. I'm worried there might be some glaringly obvious security holes in the standard setup, so I'm keen to get some ...
6
votes
4answers
311 views

Paranoid Sysadmin -vs- Out-of-Date PHP version

How can a paranoid sysadmin confidently stay up-to-date with the latest stable PHP versions? (security fixes have been coming in pretty regularly). This is a Production server, and so "breaking ...
6
votes
3answers
19k views

How can I install mysql PDO driver in Ubuntu 10.04 and PHP 5.3.2

I tried to install mysql PDO driver with this command: $ sudo pecl install pdo_mysql but I got the following error: WARNING: "pecl/PDO_MYSQL" is deprecated in favor of ...
6
votes
3answers
14k views

php writing deprecated errors to apache error log

I just upgraded from Debian Lenny to Squeeze and noticed that my /var/log/apache2/errors.log is getting bombarded with the following errors: <b>Warning</b>: Directive 'magic_quotes_gpc' ...