ant docs
+Getting librados for PHP
+-------------------------
+
+To install the ``librados`` extension for PHP, you need to execute the following procedure:
+
+#. Install php-dev. For Debian/Ubuntu, execute::
+
+ sudo apt-get install php5-dev build-essential
+
+ For CentOS/RHEL, execute::
+
+ sudo yum install php-devel
+
+#. Clone the ``phprados`` repository::
+
+ git clone https://github.com/ceph/phprados.git
+
+#. Build ``phprados``::
+
+ cd phprados
+ phpize
+ ./configure
+ make
+ sudo make install
+
+#. Enable ``phprados`` in php.ini by adding::
+
+ extension=rados.so
+
+
Step 2: Configuring a Cluster Handle
====================================
java CephClient
+PHP Example
+------------
+
+With the RADOS extension enabled in PHP you can start creating a new cluster handle very easily:
+
+.. code-block:: php
+
+ <?php
+
+ $r = rados_create();
+ rados_conf_read_file($r, '/etc/ceph/ceph.conf');
+ if (!rados_connect($r)) {
+ echo "Failed to connect to Ceph cluster";
+ } else {
+ echo "Successfully connected to Ceph cluster";
+ }
+
+
+Save this as rados.php and run the code::
+ php rados.php
+
+
Step 3: Creating an I/O Context
===============================
}
+PHP Example
+-----------
+
+.. code-block: php
+
+ $io = rados_ioctx_create($r, "mypool");
+ rados_write_full($io, "oidOne", "mycontents");
+ rados_remove("oidOne");
+ rados_ioctx_destroy($io);
+
Step 4: Closing Sessions
========================
print "Shutting down the handle."
cluster.shutdown()
+PHP Example
+-----------
+
+.. code-block:: php
+ rados_shutdown($r);