As of solr 4.0 the waitFlush parameter is removed.
If you're using the solr 4.0 or later version (and you have to),when you do this
<?php $client->commit(); ?>
you will get a solr error like this:
"Unknown commit parameter 'waitFlush'."
If you insist on using this PHP Solr extension and solr 4.0 or later version,you can edit the extension's source (version 1.0.2) php_solr_client.c.
for the SolrClient's optimize method:
at line 1490 :
zend_bool waitFlush = 1, waitSearcher = 1;
after edited:
zend_bool waitSearcher = 1;
at line 1493:
char *waitFlushValue, *waitSearcherValue;
after edited:
zend_bool waitSearcher = 1;
at line 1502:
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sbb", &maxSegments, &maxSegmentsLen, &waitFlush, &waitSearcher) == FAILURE) {
after editd:
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sb", &maxSegments, &maxSegmentsLen, &waitSearcher) == FAILURE) {
remove the line 1509 and 1515.
And do the same edit for the SolrClient's commit method at line 1561,1564,1573 and remove the line 1580,1586
The final step, compile the code and install it.
Good luck!