mod-php

Detect browser connection closed in PHP

﹥>﹥吖頭↗ 提交于 2019-12-30 08:34:50
问题 Does anyone know if it is possible to detect whether the browser has closed the connection during the execution of a long PHP script, when using apache and mod_php ? For example, in Java , the HttpOutputStream will throw an exception if one attempts to write to it after the browser has closed it -- Or will respond negatively to checkError() . 回答1: Use connection_aborted() 回答2: In at least PHP4, connection_aborted and connection_status only worked after the script sent any output to the

Including several PHP versions in Apache, switchable via AddHandler directive

穿精又带淫゛_ 提交于 2019-12-22 21:46:11
问题 A shared web host I'm using is offering several versions of PHP on the same server: 5.2, 5.3 and 5.4. They make it possible to switch between these versions by naming the file extensions .php54 and .php53 respectively, or via an .htaccess directive: AddHandler php5.4-script .php I have not been able to completely figure out how their Apache server is configured to support this though. Everything I found seemed to say that only one mod_php can be compiled into Apache at a time. Would this

Including several PHP versions in Apache, switchable via AddHandler directive

谁说我不能喝 提交于 2019-12-22 21:45:15
问题 A shared web host I'm using is offering several versions of PHP on the same server: 5.2, 5.3 and 5.4. They make it possible to switch between these versions by naming the file extensions .php54 and .php53 respectively, or via an .htaccess directive: AddHandler php5.4-script .php I have not been able to completely figure out how their Apache server is configured to support this though. Everything I found seemed to say that only one mod_php can be compiled into Apache at a time. Would this

How can I tell Apache2, run mod_php5 by default but run this VH in CGI mode?

好久不见. 提交于 2019-12-19 20:46:12
问题 The Server I have a development server that I'm using to host my current projects. Here are some stats: root@myserver:/usr/bin $ cat /etc/*-release DISTRIB_ID=Ubuntu DISTRIB_RELEASE=10.10 DISTRIB_CODENAME=maverick DISTRIB_DESCRIPTION="Ubuntu 10.10" root@myserver:/usr/bin $ apache2 -v Server version: Apache/2.2.16 (Ubuntu) Server built: Nov 18 2010 21:17:43 root@myserver:/usr/bin $ php --version PHP 5.3.3-1ubuntu9.1 with Suhosin-Patch (cli) (built: Oct 15 2010 14:00:18) Copyright (c) 1997-2009

No mod_php? 14.04 / ondrej php5.6 + ondrej apache2

蹲街弑〆低调 提交于 2019-12-13 02:23:14
问题 Trying to get a 14.04 box running PHP 5.6, but having issues getting PHP enabled in apache. Specifically, it doesn't seem mod_php is being installed anymore? apt-get update apt-get install -y python-software-properties add-apt-repository -y ppa:ondrej/php add-apt-repository -y ppa:ondrej/apache2 apt-get update apt-get upgrade -y apt-get install -y htop apache2 php5.6 php5.6-curl php5.6-mcrypt mongodb-org curl git a2enmod does not list php or mod_php , and locate php.ini outputs: /etc/php/5.6

Detect support for php_value / php_flag in .htaccess to suppress errors - PHP CGI mode - mod_php

ぐ巨炮叔叔 提交于 2019-12-10 23:33:32
问题 I use php_value and php_flag rules in .htaccess such as: php_value upload_max_filesize 100M But this causes an error when the server is running in CGI mode instead of Apache mode, and instead I have to use php.ini rules such as: upload_max_filesize = 100M My code libraries needs to work for either mode, without manual changes for each server. It took me a while to find a solution to allow both methods to be in place, and as it was hard to find I thought I'd post my solution here. 回答1: You can

Apache mod_wsgi and php in the same domain

半世苍凉 提交于 2019-12-10 20:28:05
问题 is it possible to make my webserver run python and php in the same domain? I have a website in python/django that is www.mydomain.com. Now, i have to host a blog in www.mydomain.com/blog in wordpress. Can i make it through? Apache 2.2 mod_wsgi My config now: # RUNS PYTHON <VirtualHost *:80> DocumentRoot /home/padrao ErrorLog /home/padrao/logs/mydomain.com-error_log CustomLog /home/padrao/logs/mydomain.com-access_log common WSGIScriptAlias / /home/padrao/mywebsite.wsgi </VirtualHost> # RUNS

Including several PHP versions in Apache, switchable via AddHandler directive

淺唱寂寞╮ 提交于 2019-12-06 11:43:47
A shared web host I'm using is offering several versions of PHP on the same server: 5.2, 5.3 and 5.4. They make it possible to switch between these versions by naming the file extensions .php54 and .php53 respectively, or via an .htaccess directive: AddHandler php5.4-script .php I have not been able to completely figure out how their Apache server is configured to support this though. Everything I found seemed to say that only one mod_php can be compiled into Apache at a time. Would this suggest that php5.4-script is some sort of custom wrapper module? Or are there obscure ways in which

How to prevent Apache / mod_rewrite from treating path as file with same name

我怕爱的太早我们不能终老 提交于 2019-12-05 07:20:12
问题 I'm using WAMP Server, mostly configured as-is out of the box. I'm having trouble getting mod_rewrite to behave as expected locally (everything works fine on a production server). I have a PHP file located at: /ajax/graphs/get-graph.php The way this file is normally invoked is via a bootstrap file loaded by /index.php I have a .htaccess file at the root with the following rules: RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /index.php [L] So,

Apache's mod_php OR FastCGI? Which is good for Wordpress?

ぃ、小莉子 提交于 2019-12-03 03:49:28
问题 I have basic idea about running PHP in different configurations like mod_php, cgi, FastCGI, etc. In my findings and test I found FastCGI is slightly better. I like FastCGI's support for SuEXEC most. Wait I do not want to get into benchmarking business here again. If you surf web, you will find people proving one way is faster than another in terms of number of requests handled per second. Well its good metrics but I am interested in different factors and here are my questions... Which method