Appoinmtents+says I need at least php 5.3 but php 5.4.26 is installed on the server

Hi,

I'm trying to configure the Appointments+ GCal integration but get the error message "Google PHP API Client requires at least PHP 5.3" even though the web server I use has php 5.4.26 installed http://php.binerorockar.se

Is there a workaround for this?

  • aristath

    Hello there @Magnus and welcome to the WPMUDEV Community!

    I have notified the plugin developer about this issue, we should have that fixed asap.
    In the meantime, you can bypass these checks by editing this file: wp-content/plugins/appointments/includes/class.gcal.php
    Lines 785-814 currently look like this:

    function is_not_suitable( $worker_id=0 ) {
    
    		if ( version_compare( $this->db_version, '1.2.0', '<' ) )
    			return __('You have to update the Appointments+ tables. To do so, deactivate and reactivate the plugin.','appointments');
    
    		if ( version_compare(PHP_VERSION, '5.3.0', '<') )
    			return __('Google PHP API Client requires at least PHP 5.3','appointments');
    
    		// Disabled for now
    		if ( false && memory_get_usage() < 31000000 )
    			return sprintf( __('Google PHP API Client requires at least 32 MByte Server RAM. Please check this link how to increase it: %s','appointments'), '<a href="http://codex.wordpress.org/Editing_wp-config.php#Increasing_memory_allocated_to_PHP" target="_blank">'.__('Increasing_memory_allocated_to_PHP','appointments').'</a>');
    
    		if (!function_exists('curl_init'))
    			return __('Google PHP API Client requires the CURL PHP extension','appointments' );
    
    		if (!function_exists('json_decode'))
    			return __('Google PHP API Client requires the JSON PHP extension','appointments');
    
    		if ( !function_exists('http_build_query'))
    			return __('Google PHP API Client requires http_build_query()','appointments');
    
    		// Dont continue further if this is pre check
    		if ( isset( $_GET['gcal_api_pre_test'] ) && 1== $_GET['gcal_api_pre_test'] )
    			return __('Your server installation meets requirements.','appointments');
    
    		if ( !$this->_file_exists( $worker_id ) )
    			return __('Key file does not exist','appointments');
    
    		return '';
    	}

    replace them with this:

    function is_not_suitable( $worker_id=0 ) {
    
    		if ( version_compare( $this->db_version, '1.2.0', '<' ) )
    			return __('You have to update the Appointments+ tables. To do so, deactivate and reactivate the plugin.','appointments');
    
    		// Disabled for now
    		if ( false && memory_get_usage() < 31000000 )
    			return sprintf( __('Google PHP API Client requires at least 32 MByte Server RAM. Please check this link how to increase it: %s','appointments'), '<a href="http://codex.wordpress.org/Editing_wp-config.php#Increasing_memory_allocated_to_PHP" target="_blank">'.__('Increasing_memory_allocated_to_PHP','appointments').'</a>');
    
    		if (!function_exists('curl_init'))
    			return __('Google PHP API Client requires the CURL PHP extension','appointments' );
    
    		if (!function_exists('json_decode'))
    			return __('Google PHP API Client requires the JSON PHP extension','appointments');
    
    		if ( !function_exists('http_build_query'))
    			return __('Google PHP API Client requires http_build_query()','appointments');
    
    		// Dont continue further if this is pre check
    		if ( isset( $_GET['gcal_api_pre_test'] ) && 1== $_GET['gcal_api_pre_test'] )
    			return __('Your server installation meets requirements.','appointments');
    
    		if ( !$this->_file_exists( $worker_id ) )
    			return __('Key file does not exist','appointments');
    
    		return '';
    	}

    (in other words, just delete lines 790-791)

    I hope that helps!

    Cheers,
    Ari.

  • magnuskolsjo

    Thanks,

    That took me past the error message shown when testing the connection. However the logg shows:
    [Sep 6, 2014 17:51] Insert went wrong: PHP 5.3.0 or higher is required to use service accounts.

    And when I try to Import and Updated events the Google Calendar tab turns blank and the log says:
    [Sep 6, 2014 17:52] exception 'Google_AuthException' with message 'PHP 5.3.0 or higher is required to use service accounts.' in /storage/content/02/159302/simontfitness.com/public_html/wp-content/plugins/appointments/includes/gcal/auth/Google_P12Signer.php:63
    Stack trace:...

  • Jose

    Hey there @Magnus,

    This seems to be some conflict to get the PHP version in your server. (Certainly weird). I'll need to take a look at your install.

    Can you please send me the following information via contact form :

    - In the subject field add "Attn: Jose”
    - Link back to this thread
    - Include WP admin/network access
    - Include FTP
    - Include any relevant URLS for your site

    On the contact form, select "I have a different question", this ensures it comes through and gets assigned to me.

    Thanks,
    Jose

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.