Questions tagged [php]

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.

PHP is an open-source general-purpose scripting language that is suited and popular for server-side Web Development. There is an excellent online manual and a wiki. The online manual is a complete reference for syntax, built in functions, and extensions. There are lots of extensions for PHP that most of them can be find in PECL.

If you want to post a question in PHP, check the error log or if errors are enabled, enter them from output of your script if any.

7887 questions
43
votes
6 answers

Which PHP (opcode) cache one should use and why?

I keep hearing about some PHP (opcode) caches like - APC, XCache, Memcache, eAccelerator, etc. But I couldn't ever figure out how to go about choosing one. Apart from performance benefit, which a caching system is supposed to deliver, which other…
rahul286
  • 1,647
  • 5
  • 20
  • 25
42
votes
4 answers

Setup ubuntu server to send mail()

I tried searching a lot but unable to find how to actually setup a ubuntu server, so that I can send mails through php using mail() function in php. I have apache2, mysql and php5 installed on my server. Thank You.
Shishant
  • 683
  • 2
  • 8
  • 13
41
votes
11 answers

Got Hacked. Want to understand how

Someone has, for the second time, appended a chunk of javascript to a site I help run. This javascript hijacks Google adsense, inserting their own account number, and sticking ads all over. The code is always appended, always in one specific…
Lothar_Grimpsenbacher
  • 1,677
  • 3
  • 19
  • 29
40
votes
4 answers

What's a secure alternative to using a MySQL password on the command line?

We have a PHP command-line script to version a database. We run this script whenever a developer has added a new database patch. The script runs the patch with the MySQL command-line: system('mysql --user=xxx --password=xxx < patch.sql'); However,…
BenMorel
  • 4,507
  • 10
  • 57
  • 85
40
votes
3 answers

How do I uninstall a Web Platform Installer (WPI) installation of PHP?

We've installed PHP on a Windows Server 2008 R2 box using Web Platform Installer (WPI) 3.0.x. However, I'd like to uninstall PHP (5.3 in particular, leaving 5.2 as-is). Unfortunately, an uninstall option doesn't exist in Programs and Features, and…
James Skemp
  • 872
  • 2
  • 10
  • 21
39
votes
5 answers

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). This terminal command: php --version is showing 5.2.8 and I have the right modules installed. But, when I do a phpinfo(), Apache…
Sam McAfee
  • 543
  • 1
  • 5
  • 7
39
votes
4 answers

Why Swap is used when plenty of free memory is left?

I have pretty good web (dedicated) server with good memory resources: System information Server load 2.19 (8 CPUs) Memory Used 29.53% (4,804,144 of 16,267,652) Swap Used 10.52% (220,612 of 2,097,136) As you can see, my server is…
mahen3d
  • 4,342
  • 14
  • 36
  • 57
39
votes
6 answers

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 or warnings. The returned status code of the…
Silvio Donnini
  • 517
  • 1
  • 7
  • 9
38
votes
4 answers

How To Change What Version of PHP Apache2 Uses?

Ubuntu 10.04, MySQL 5.1, Apache 2.2, and PHP 5.2/5.3: I just discovered that I am using the wrong version of PHP for a CRM application. Once I figured out how to make a simple phpinfo() script to tell me what Apache2 is using, I tried changing the…
nicorellius
  • 585
  • 2
  • 5
  • 23
37
votes
10 answers

How to solve `configure: error: Cannot find OpenSSL's `?

Im trying to recompile PHP, but ./configure fails at : configure: error: Cannot find OpenSSL's I have LibSSL 1.0.0, LibSSL 0.9.8, LibSSL-Dev, OpenSSL installed. --with-openssl=/usr/include/openssl when I try with --with-openssl tells…
CappY
  • 513
  • 1
  • 6
  • 11
35
votes
3 answers

How do you Install PHP5 without installing Apache in ubuntu?

Is it possible to install PHP5 without installing apache, in Ubuntu? If so, how?
Ryan
  • 5,831
  • 24
  • 72
  • 91
34
votes
4 answers

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 detailed logs or anything. However, when going to PHP Manager for IIS and click check config, I get the following error: Detailed Error…
alexander7567
  • 541
  • 2
  • 6
  • 18
34
votes
1 answer

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 is. I'm specifically looking for the Nginx config…
tim peterson
  • 693
  • 2
  • 9
  • 18
33
votes
3 answers

PHP: What are the advantages of FastCGI over mod_php?

It was recently suggested to me that I use FastCGI with PHP. Now I went to the FastCGI page and read it but I don't really understand what the advantages are.
cletus
  • 9,999
  • 9
  • 37
  • 40
33
votes
6 answers

RSA certificate configured for SERVER does NOT include an ID which matches the server name

I recently started a LAMP server (all the latest versions) w/ WordPress on it, and I'm trying to install a SSL certificate that I recently purchased. When I restart apachectl, error_log gives me this: [Tue Feb 25 01:07:14.744222 2014]…
eclipsis
  • 433
  • 1
  • 4
  • 9