To use the functions of CUBRID HA in PHP, connect it to the broker by using cubrid_connect_with_url, which is used to specify the connection information of the failover broker in the connection URL. The attribute specified for CUBRID HA is althosts, the information on one or more broker nodes to connect when a failover occurs.
The following example shows how to configure PHP.
$con = cubrid_connect_with_url ("cci:CUBRID:primary_broker:33000:testdb:::?althosts=secondary_broker:33000", "dba", NULL);
if ($con < 0)
printf ("cannot connect to database ");