Cara menggunakan php socket timeout

Senin, 01 April 2019 Tambah Komentar Edit

Show

Cara menggunakan php socket timeout

untuk mengatasi Fatal error Connection timed out pada PHP, sebetulnya bisa kita atasi tanpa harus mengkonfigurasi ulang file PHP.ini..

Kita tinggal tambahkan sedikit koding saja di dalam file controller kita, syntax nya adalah seperti ini :

 

Simple kan? semoga membantu..

Define additional database driver options

Additional driver options for the database connection, e.g. to enable SSL encryption in MySQL or specify a custom wait timeout on a cheap hoster.

Code Sample

'dbdriveroptions' => [
	PDO::MYSQL_ATTR_SSL_CA => '/file/path/to/ca_cert.pem',
	PDO::MYSQL_ATTR_INIT_COMMAND => 'SET wait_timeout = 28800'
  ],

Define sqlite3 journal mode

sqlite3 journal mode can be specified using this configuration parameter - can be 'WAL' or 'DELETE' see for more details https://www.sqlite.org/wal.html

Code Sample

'sqlite.journal_mode' => 'DELETE',

Define MySQL 3/4 byte character handling

During setup, if requirements are met (see below), this setting is set to true and MySQL can handle 4 byte characters instead of 3 byte characters.

If you want to convert an existing 3-byte setup into a 4-byte setup please set the parameters in MySQL as mentioned below and run the migration command: sudo -u www-data ./occ db:convert-mysql-charset The config setting will be set automatically after a successful run.

Consult the documentation for more details.

MySQL requires a special setup for longer indexes (> 767 bytes) which are needed:

[mysqld]
innodb_large_prefix=ON
innodb_file_format=Barracuda
innodb_file_per_table=ON

Tables will be created with * character set: utf8mb4 * collation: utf8mb4_bin * row_format: compressed

Code Sample

'mysql.utf8mb4' => false,

Force a specific database platform class

False means that autodetection will take place.

E.g. to fix MariaDB 1.2.7+ taken for MySQL 'db.platform' ⇒ '\Doctrine\DBAL\Platforms\MariaDb1027Platform',

Code Sample

Define supported database types

Database types that are supported for installation.

Available: - sqlite (SQLite3 - Not in Enterprise Edition) - mysql (MySQL) - pgsql (PostgreSQL) - oci (Oracle - Enterprise Edition Only)

Code Sample

'supportedDatabases' => [
	'sqlite',
	'mysql',
	'pgsql',
	'oci',
  ],

Define the location for temporary files

Override where ownCloud stores temporary files. Useful in situations where the system temporary directory is on a limited space ramdisk or is otherwise restricted, or if external storages which do not support streaming are in use.

The Web server user must have write access to this directory.

Code Sample

'tempdirectory' => '/tmp/owncloudtemp',

Define the hashing cost

The hashing cost used by hashes generated by ownCloud.

Using a higher value requires more time and CPU power to calculate the hashes. As this number grows, the amount of work (typically CPU time or memory) necessary to compute the hash increases exponentially.

Code Sample

Define blacklisted files

Blacklist a specific file or files and disallow the upload of files with this name. .htaccess is blocked by default.

USE THIS ONLY IF YOU KNOW WHAT YOU ARE DOING.

Code Sample

'blacklisted_files' => [
	'.htaccess'
  ],

Define blacklisted files regular expression(s)

Blacklist files that match any of the given regular expressions and disallow the upload of those files. The matching is case-insensitive.

USE THIS ONLY IF YOU KNOW WHAT YOU ARE DOING.

Code Sample

'blacklisted_files_regex' => [
	'.*\.ext',
	'^somefilename.*'
  ],

Define excluded directories

Exclude specific directory names and disallow scanning, creating and renaming using these names. The matching is case-insensitive.

Excluded directory names are queried at any path part like at the beginning, in the middle or at the end and will not be further processed if found. Please see the documentation for details and examples. Use when the storage backend supports, e.g. snapshot directories to be excluded.

USE THIS ONLY IF YOU KNOW WHAT YOU ARE DOING.

Code Sample

'excluded_directories' => [
	'.snapshot',
	'~snapshot',
  ],

Define excluded directories regular expression(s)

Exclude directory names that match any of the given regular expressions and disallow scanning, creating and renaming using these names. The matching is case-insensitive.

Excluded directory names are queried at any path part like at the beginning, in the middle or at the end and will not be further processed if found. Please see the documentation for details and examples. Use when the storage backend supports, e.g. snapshot directories to be excluded.

USE THIS ONLY IF YOU KNOW WHAT YOU ARE DOING.

Code Sample

'excluded_directories_regex' => [
	'^backup.*',
	'.*backup$',
  ],

Define files that are excluded from integrity checking

Exclude files from the integrity checker command

Code Sample

'integrity.excluded.files' => [
	'.DS_Store',
	'Thumbs.db',
	'.directory',
	'.webapp',
	'.htaccess',
	'.user.ini',
  ],

Define apps or themes that are excluded from integrity checking

The list of apps that are allowed and must not have a signature.json file present.

Besides ownCloud apps, this is particularly useful when creating ownCloud themes, because themes are treated as apps. The app is identified with it´s app-id. The app-id can be identified by the foldername of the app in your apps directory. The following example allows app-1 and theme-2 to have no signature.json file.

Code Sample

'integrity.ignore.missing.app.signature' => [
	'app-id of app-1',
	'app-id of theme-2',
  ],

Define a default folder for shared files and folders other than root

Code Sample

Define the default cipher for encrypting files

Currently AES-128-CFB and AES-256-CFB are supported.

Code Sample

'cipher' => 'AES-256-CFB',

Define the file format for encrypting files

Define if encrypted files will be written in the old format (true) or the new binary format (false) which has a significant reduced filesize. Defaults to false.

With binary, only new files are written in the binary format, existing encrypted files in the old format stay readable. This guarantees a smooth transition.

Code Sample

'encryption.use_legacy_encoding' => false,

Define the minimum supported ownCloud desktop client version

Define the minimum ownCloud desktop client version that is allowed to sync with this server instance. All connections made from earlier clients will be denied by the server.

As shipped, the value here is the oldest desktop client that is technically compatible with the server. The version number seen here does not imply official support or test coverage on behalf of ownCloud.

Lowering this value may lead to unexpected behaviour, and can include data loss.

Code Sample

'minimum.supported.desktop.version' => '2.3.3',

Define the suggested poll interval for clients

Specifies how often clients should poll the server for changes.

The value is in milliseconds. The value is not enforced. Clients may use this value to decide how frequently to check the server for changes.

Code Sample

Define whether to include external storage in quota calculation

EXPERIMENTAL: option whether to include external storage in quota calculation, defaults to false.

Code Sample

'quota_include_external_storage' => false,

Define how often filesystem changes are detected

Specifies how often the local filesystem (the ownCloud data/ directory, and NFS mounts in data/) is checked for changes made outside ownCloud. This does not apply to external storages.

→ Never check the filesystem for outside changes, provides a performance increase when it’s certain that no changes are made directly to the filesystem

→ Check each file or folder at most once per request, recommended for general use if outside changes might happen.

Code Sample

'filesystem_check_changes' => 0,

Define unsuccessful mountpoint rename attempts

This config value avoids infinite loops for seldom cases where a file renaming conflict between different share backends could occur.

The value defines how many unsuccessful mountpoint rename attempts are allowed. e.g. target mountpoint name could be claimed as unused by the filesystem but renaming to this target name will fail due to some other reasons like database constraints. Change this value only under supervision of ownCloud support.

Code Sample

'filesystem.max_mountpoint_move_attempts' => 10,

Define where part files are located

By default ownCloud will store the part files created during upload in the same storage as the upload target. Setting this to false will store the part files in the root of the user’s folder which might be required to work with certain external storage setups that have limited rename capabilities.

Note that setting this to false causes issues with the following apps: Encryption, Document classification, Anti-Virus and Ransomware Protection.

Code Sample

'part_file_in_storage' => true,

Prevent cache changes due to changes in the filesystem

When true, prevent ownCloud from changing the cache due to changes in the filesystem for all storage.

Code Sample

'filesystem_cache_readonly' => false,

Define ownClouds internal secret

Secret used by ownCloud for various purposes, e.g. to encrypt data.

If you lose this string there will be data corruption.

Code Sample

Define list of trusted proxy servers

If you configure these also consider setting forwarded_for_headers which otherwise defaults to HTTP_X_FORWARDED_FOR (the X-Forwarded-For header).

Code Sample

'trusted_proxies' => [
	'203.0.113.45',
	'198.51.100.128'
  ],

Headers that should be trusted as client IP address in combination with trusted_proxies. If the HTTP header looks like 'X-Forwarded-For', then use 'HTTP_X_FORWARDED_FOR' here.

If set incorrectly, a client can spoof their IP address as visible to ownCloud, bypassing access controls and making logs useless!

If not set, defaults to 'HTTP_X_FORWARDED_FOR'.

Code Sample

'forwarded_for_headers' => [
	'HTTP_X_FORWARDED',
	'HTTP_FORWARDED_FOR'
  ],

Define the maximum filesize for animated GIF´s

Max file size for animating gifs on public-sharing-site.

If the gif is bigger, it’ll show a static preview.

Value represents the maximum filesize in megabytes. Default is 10. Set to -1 for no limit.

Code Sample

'max_filesize_animated_gifs_public_sharing' => 10,

Enable transactional file locking

Transactional file locking is enabled by default.

Prevents concurrent processes from accessing the same files at the same time. Can help prevent side effects that would be caused by concurrent operations. Mainly relevant for very large installations with many users working with shared files.

Code Sample

'filelocking.enabled' => true,

Define the TTL for file locking

Set the lock’s time-to-live in seconds.

Any lock older than this will be automatically cleaned up. If not set this defaults to either 1 hour or the php max_execution_time, whichever is higher.

Code Sample

'filelocking.ttl' => 3600,

Define the memory caching backend for file locking

Because most memcache backends can clean values without warning, using redis is highly recommended to avoid data loss.

Code Sample

'memcache.locking' => '\\OC\\Memcache\\Redis',

Disable the web based updater

The web based updater is enabled by default.

Code Sample

'upgrade.disable-web' => false,

Define whether or not to enable automatic update of market apps

Set to false to disable.

Code Sample

'upgrade.automatic-app-update' => true,

Enable debugging mode for this ownCloud instance

Only enable this for local development and not in production environments This will disable the minifier and outputs some additional debug information

WARNING: Be warned that, if you set this to true, exceptions display stack traces on the web interface, including passwords, — in plain text!. Furthermore the content-disposition header will be lost and thus files will be displayed in the browser rather than downloaded. We strongly encourage you never to use it in production.

Code Sample

Define the data-fingerprint of the current data served

This is a property used by the clients to find out if a backup has been restored on the server. Once a backup is restored run sudo -u www-data ./occ maintenance:data-fingerprint To set this to a new value.

Updating/Deleting this value can make connected clients stall until the user has resolved conflicts.

Code Sample

'data-fingerprint' => '',

Define if you have copied the sample configuration

This entry is just here to show a warning in case somebody copied the sample configuration.

DO NOT ADD THIS SWITCH TO YOUR CONFIGURATION!

If you, brave person, have read until here be aware that you should not modify ANY settings in this file without reading the documentation.

Code Sample

'copied_sample_config' => true,

Enable or disable the files_external local mount option

Set this property to true if you want to enable the files_external local mount option.

Default: false

Code Sample

'files_external_allow_create_new_local' => false,

Enable or disable debug logging for SMB access

Set this property to true if you want to enable debug logging for SMB access.

Code Sample

'smb.logging.enable' => false,

Enable or disable async DAV extensions

Code Sample

'dav.enable.async' => false,

Enable propfind depth infinity requests

Tell the clients whether depth=infinity is allowed for propfind requests.

Code Sample

'dav.propfind.depth_infinity' => false,

Decide whether show or not the grace period popup. There is no change in the behaviour of the grace period.

Code Sample

'grace_period.demo_key.show_popup' => true,

The admin will be directed to that web page when they click on the "get a demo key" link in the grace period popup. It’s expected that the web page contains instructions on how to get a valid demo key to be used in the ownCloud server.

If this key isn’t present, ownCloud’s default will be used.

Code Sample

'grace_period.demo_key.link' => 'https://owncloud.com/try-enterprise/',