Skip to content

Commit

Permalink
Merge pull request #1085 from owncloud/phpfpm
Browse files Browse the repository at this point in the history
a few tweaks to php-fpm section
  • Loading branch information
Carla Schroder committed Apr 24, 2015
2 parents 7cc27a3 + 303efab commit d9f6cef
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 17 deletions.
2 changes: 1 addition & 1 deletion admin_manual/installation/nginx_configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -105,4 +105,4 @@ Nginx Configuration
- Remove **ssl_certificate** and **ssl_certificate_key**.
- Remove **fastcgi_params HTTPS on;**
.. note:: Please read the "Configuration notes to php-fpm" :ref:`using_php-fpm`
.. note:: If you are using php-fpm please read :ref:`using_php-fpm`
54 changes: 38 additions & 16 deletions admin_manual/installation/source_installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,8 @@ Apache is the recommended Web server.
Configuration notes to php.ini files
------------------------------------

Keep in mind that changes to php.ini may have to be done on more than one ini file. This can be the case, as example, for the
``date.timezone`` setting.
Keep in mind that changes to ``php.ini`` may have to be done on more than one
ini file. This can be the case, as example, for the ``date.timezone`` setting.

**php.ini - used by the webserver:**
::
Expand All @@ -279,48 +279,70 @@ Keep in mind that changes to php.ini may have to be done on more than one ini fi


.. _using_php-fpm:

Configuration notes to php-fpm
------------------------------

**System environment variables**

It may be the case when using ``php-fpm``, system environment variables like PATH, TMP or others are not automatically populated in the same way compared when using ``php-cli``.

A php call like ``getenv('PATH');`` can therefore return an empty result. Even fallback data with most commonly used content for those variables is most times defined, this may not match 100% of the requirements. In those cases, the variables need to be set manually in the corresponding ``php-fpm`` ini/config file.
When you are using ``php-fpm``, system environment variables like
PATH, TMP or others are not automatically populated in the same way as when
when using ``php-cli``. A PHP call like ``getenv('PATH');`` can therefore
return an empty result. So you may need to manually configure environment
varibles in the appropropriate ``php-fpm`` ini/config file.

Example root path for these ini/config files:
Here are some example root paths for these ini/config files:

+--------------------+-----------------------+
| Ubuntu/Mint | CentOS/Red Hat/Fedora |
+--------------------+-----------------------+
| ``/etc/php5/fpm/`` | ``/etc/php-fpm.d/`` |
+--------------------+-----------------------+

In both examples, the ini/config file is called ``www.conf`` where it may be stored in an subdirectory.
In both examples, the ini/config file is called ``www.conf``, and depending on
the distro version or customizations you have made, it may be in a subdirectory.

Usually, you will find some or all of the environment variables beeing commented out like:
::
Usually, you will find some or all of the environment variables
already in the file, but commented out like this::

;env[HOSTNAME] = $HOSTNAME
;env[PATH] = /usr/local/bin:/usr/bin:/bin
;env[TMP] = /tmp
;env[TMPDIR] = /tmp
;env[TEMP] = /tmp

You can either just uncomment the existing one and/or copy the output from the command shell eg: ``printenv PATH`` (example: ``/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin``) to the environment variable to be set. If no system environment variable is present to be uncommented, you need to create one.
Uncomment the appropriate existing entries. Then run ``printenv PATH`` to
confirm your paths, for example::

$ printenv PATH
/home/user/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:
/sbin:/bin:/

If any of your system environment variables are not present in the file then
you must add them.

Consider when using shared hosting or a control panel to manage your VM or server to read the documentation which comes with that software as the configuration files are almost certain to be located somewhere else, for security and flexibility reasons.
When you are using shared hosting or a control panel to manage your ownCloud VM
or server, the configuration files are almost certain to be located somewhere
else, for security and flexibility reasons, so check your documentation for the
correct locations.

Please keep in mind, that it is possible to create different settings for ``php-cli`` and ``php-fpm``
and even for different domains/websites. Please take care to take the right one. Your result can be tested with ``phpinfo()`` which must accessed via a browser to your domain/website.
Please keep in mind that it is possible to create different settings for
``php-cli`` and ``php-fpm``, and for different domains and Web sites.
The best way to check your settings is with ``phpinfo()``.

**Maximum upload size**

If you want to effectively increase the maximum upload size, you will also have to modify your ``php-fpm`` configuration (usually at ``example_paths_above/php.ini``) and increase ``upload_max_filesize`` and ``post_max_size`` values. You will need to restart ``php5-fpm`` and ``webserver`` services in order for these changes to be applied.
If you want to increase the maximum upload size, you will also have to modify
your ``php-fpm`` configuration and increase the ``upload_max_filesize`` and
``post_max_size`` values. You will need to restart ``php5-fpm`` and your HTTP
server in order for these changes to be applied.

**.htaccess notes for webservers \<> Apache**

ownCloud comes with its own ``owncloud/.htaccess`` file. If ``php-fpm`` is used, it can't read ``.htaccess`` PHP settings unless the ``htscanner`` PECL extension is installed. If ``php-fpm`` is used without this PECL extension installed, settings and permissions must be set in the ``owncloud/.user.ini`` file.
ownCloud comes with its own ``owncloud/.htaccess`` file. ``php-fpm`` can't
read PHP settings in ``.htaccess`` unless the ``htscanner`` PECL extension is
installed. If ``php-fpm`` is used without this PECL extension installed,
settings and permissions must be set in the ``owncloud/.user.ini`` file.

Other Web Servers
-----------------
Expand All @@ -335,4 +357,4 @@ See :doc:`yaws_configuration`

**Hiawatha Configuration**

See :doc:`hiawatha_configuration`
See :doc:`hiawatha_configuration`

0 comments on commit d9f6cef

Please sign in to comment.