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
33
votes
6 answers

How can I display and log PHP errors on IIS7?

We're running PHP 5.2.5 on an IIS 7 Server and we're having problems making PHP errors visible... At the moment whenever we have a PHP error the server sends back a 500 error with the message "The page cannot be displayed because an internal server…
Ben
  • 463
  • 1
  • 6
  • 8
32
votes
4 answers

Switch from PHP 7.2 to 7.1 on Ubuntu 16.04, Apache

I need to downgrade PHP on one of my VMs from 7.2 to 7.1 on Ubuntu 16.0.4. The last time I tried to remove just PHP and replace it with a different version, I had all kinds of issues with Apache and MySQL. Is there a quick way to downgrade PHP from…
Pegues
  • 901
  • 1
  • 7
  • 9
31
votes
5 answers

Why not use a WAMP stack?

This is a canonical question about the use of a *AMPP's stack. I recently had a talk with some experienced people and they suggested to me not to use a WAMP stack, and instead install apache, mysql and php separately. I don't understand why they…
matang
  • 446
  • 1
  • 4
  • 5
31
votes
8 answers

Securing PHP webservers

PHP applications have a reputation for higher than average security problems. What configuration techniques do you use for making sure the application is secure as possible? I'm looking for ideas like: Using Hardened PHP/Suhosin Using…
David Pashley
  • 23,497
  • 2
  • 46
  • 73
30
votes
6 answers

How do I find out where the web site's code resides?

The facts: there is a website this website is accessible via www.example.org there is an EC2 instance which very likely keeps the website the server is Apache the server OS is Ubuntu I have full access to the server (and sudo privileges) the…
Raffael
  • 689
  • 7
  • 15
30
votes
2 answers

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 ] && [ -d /var/lib/php5 ] && find /var/lib/php5/…
nulll
  • 505
  • 1
  • 5
  • 9
29
votes
1 answer

How to install PECL on a linux system

There are download sections for PECL extensions in http://pecl.php.net/ But I am not getting install steps for PECL *itself**. Following command does not work - yum intall pecl In my system, I have PECL installed, so I can install PECL extensions…
Sandeepan Nath
  • 647
  • 6
  • 13
  • 29
28
votes
5 answers

Permission Denied for fastcgi_pass using PHP7

I'm running LEMP with PHP7.0. I've got this in my server block fastcgi_pass unix:/var/run/php/php7.0-fpm.sock; But when I open the site, it returns a 502 Bad Gateway. Below is the error log. *1 connect() to unix:/var/run/php/php7.0-fpm.sock failed…
julio
  • 904
  • 1
  • 9
  • 13
28
votes
9 answers

Apache2 Proxy timeout

I have Apache2 with PHP + PHP-FPM configured according to: http://wiki.apache.org/httpd/PHP-FPM I am writing a script that will take a long time to execute on an internal Vhost, but keep getting timed out, everything runs flawlessly if the script…
wyqydsyq
  • 395
  • 1
  • 3
  • 9
28
votes
1 answer

php-mysqlnd or php-mysql

Long story short: just installed Ubuntu 12.04 (Debian based), nginx, php-fpm and mysql. Now I need the MySQL driver for PHP, but which should I choose? Which is better php-mysqlnd or php-mysql?
Thomas Jensen
  • 517
  • 2
  • 5
  • 9
28
votes
11 answers

MySQL cannot connect via "localhost", only 127.0.0.1

this is somewhat of a mystery to me. The only way I can connect to MySQL is if I call it via "127.0.0.1" ... for example, my PHP connect script will NOT work with localhost I'm running Mac OS X Lion, built-in apache2, MySQL, PHP,…
dcolumbus
  • 475
  • 1
  • 5
  • 10
28
votes
1 answer

Memory Usage Numbers In top/htop

Can someone please explain this top output. Each PHP process is using 30% of the total memory or of the used memory? Furthermore how can it be that the combined used memory across all the PHP processes far exceeds my system memory? Is this the…
Mem
  • 301
  • 2
  • 4
  • 5
27
votes
5 answers

Apache file negotiation failed

I'm having the following issue on a host using Apache 2.2.22 + PHP 5.4.0 I need to provide the file /home/server1/htdocs/admin/contents.php when a user makes the request: http://server1/admin/contents, but I obtain this message on the server…
lorenzo.marcon
  • 1,027
  • 1
  • 11
  • 20
26
votes
1 answer

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 |…
BenMorel
  • 4,507
  • 10
  • 57
  • 85
25
votes
7 answers

Where is apc.php?

Using Ubuntu server 10.4, I apt-getted php-apc Where is the apc.php file that I'm meant to copy? Thanks!
Ben