Title: Error in Apache logs
Last modified: June 2, 2021

---

# Error in Apache logs

 *  Resolved [opicron](https://wordpress.org/support/users/opicron/)
 * (@opicron)
 * [5 years ago](https://wordpress.org/support/topic/error-in-apache-logs-2/)
 * The following error is piling up in my error logs of Apache and it is causing
   my ecommerce site to not function. Rolling back now.
 * ‘PHP message: PHP Parse error: syntax error, unexpected ‘)’ in /var/www/html/
   wp-content/plugins/wplr-sync/classes/rest.php on line 371\n’

Viewing 12 replies - 1 through 12 (of 12 total)

 *  Plugin Author [Jordy Meow](https://wordpress.org/support/users/tigroumeow/)
 * (@tigroumeow)
 * [5 years ago](https://wordpress.org/support/topic/error-in-apache-logs-2/#post-14511792)
 * Hi [@opicron](https://wordpress.org/support/users/opicron/),
 * Strange, I looked at the code, but I don’t know why that exact line would cause
   an error.
 * Would you mind looking at that file and pasting that line? (and maybe a few lines
   around it too)
 * That will be fixed, in a way or another, syntax errors are easy to fix.
 *  Plugin Author [Jordy Meow](https://wordpress.org/support/users/tigroumeow/)
 * (@tigroumeow)
 * [5 years ago](https://wordpress.org/support/topic/error-in-apache-logs-2/#post-14511874)
 * Which version of PHP are you running?
 *  Thread Starter [opicron](https://wordpress.org/support/users/opicron/)
 * (@opicron)
 * [5 years ago](https://wordpress.org/support/topic/error-in-apache-logs-2/#post-14511890)
 * PHP:
 * `PHP Version 7.2.34-9+ubuntu18.04.1+deb.sury.org+1`
 * Code line 360-373:
 *     ```
       $results = $wpdb->get_results(
       			$wpdb->prepare(
       				"SELECT p.ID, p.post_title, p.post_content as description, p.post_excerpt as caption, pm1.meta_value as alt, pm2.meta_value as path 
       				FROM $wpdb->posts p 
       				LEFT JOIN $wpdb->postmeta pm1 ON pm1.post_id = p.ID AND pm1.meta_key = '_wp_attachment_image_alt' 
       				LEFT JOIN $wpdb->postmeta pm2 ON pm2.post_id = p.ID AND pm2.meta_key = '_wp_attached_file' 
       				WHERE post_type='attachment' 
       				AND post_status='inherit' 
       				AND ID IN (" . $mediaIdsPlaceholders . ") 
       				$orderSql 
       				LIMIT %d, %d", array_merge($mediaIds, [$skip, $limit] ),
       			), ARRAY_A
       		);
       ```
   
 * Also no other errors appear in the error logs. Only the one mentioned in OP.
 *  [Martin Junius](https://wordpress.org/support/users/n0ll/)
 * (@n0ll)
 * [5 years ago](https://wordpress.org/support/topic/error-in-apache-logs-2/#post-14523582)
 * Same problem here after the update to
    Photo Engine (WP/LR Sync) 6.0.5 WP/LR 
   Theme Assistant 0.5.4
 * I’m also running PHP 7.2.24-0ubuntu0.18.04.7. Yes, I do know that an update is
   due … 😉
 * For the time being I had to disable both plugins to be able to use the WP backend
   again.
 * Thanks for looking into this.
 * Error log:
 *     ```
       [Sat Jun 05 18:24:44.440425 2021] [php7:emerg] [pid 9065] [client 91.37.181.4:57744] PHP Parse error:  syntax error, unexpected ')' in /var/www-server/photo/blog/wp-content/plugins/wplr-sync/classes/rest.php on line 371, referer: https://xxx/blog/wp-admin/admin.php?page=wplr_sync_settings
       [Sat Jun 05 18:25:48.014455 2021] [php7:emerg] [pid 11779] [client 91.37.181.4:57760] PHP Parse error:  syntax error, unexpected ')' in /var/www-server/photo/blog/wp-content/plugins/wplr-sync/classes/rest.php on line 371, referer: https://xxx/blog/wp-admin/admin.php?page=wplr_sync_settings
       [Sat Jun 05 18:26:43.048223 2021] [php7:error] [pid 12229] [client 91.37.181.4:57764] PHP Fatal error:  Uncaught Error: Call to a member function get_meta_from_value() on null in /var/www-server/photo/blog/wp-content/plugins/wplr-theme-assistant/wplr-theme-assistant.php:97\nStack trace:\n#0 /var/www-server/photo/blog/wp-includes/class-wp-hook.php(292): WPLR_Theme_Assistant->manage_posts_custom_column('WPLRSync_PostTy...', 2)\n#1 /var/www-server/photo/blog/wp-includes/class-wp-hook.php(316): WP_Hook->apply_filters('', Array)\n#2 /var/www-server/photo/blog/wp-includes/plugin.php(484): WP_Hook->do_action(Array)\n#3 /var/www-server/photo/blog/wp-admin/includes/class-wp-posts-list-table.php(1255): do_action('manage_pages_cu...', 'WPLRSync_PostTy...', 2)\n#4 /var/www-server/photo/blog/wp-admin/includes/class-wp-list-table.php(1447): WP_Posts_List_Table->column_default(Object(WP_Post), 'WPLRSync_PostTy...')\n#5 /var/www-server/photo/blog/wp-admin/includes/class-wp-posts-list-table.php(1315): WP_List_Table->single_row_columns(Object(WP_Post))\n#6 /var/www-server/photo/blog/wp-admin/includes/class-wp-posts-list-table.php(852):  in /var/www-server/photo/blog/wp-content/plugins/wplr-theme-assistant/wplr-theme-assistant.php on line 97, referer: https://xxx/blog/wp-admin/plugins.php?plugin_status=all&paged=1&s
       ```
   
 *  [Martin Junius](https://wordpress.org/support/users/n0ll/)
 * (@n0ll)
 * [4 years, 12 months ago](https://wordpress.org/support/topic/error-in-apache-logs-2/#post-14542063)
 * [@tigroumeow](https://wordpress.org/support/users/tigroumeow/) any news here?
   Otherwise I have to roll back to the previous version.
    Thx.
 *  Plugin Author [Jordy Meow](https://wordpress.org/support/users/tigroumeow/)
 * (@tigroumeow)
 * [4 years, 12 months ago](https://wordpress.org/support/topic/error-in-apache-logs-2/#post-14542067)
 * Yes, I was working on a new version, and I just released a few minutes ago. Can
   you try it? 🙂
 * I worked on this issue too, I was replying to some customers.
 *  [Martin Junius](https://wordpress.org/support/users/n0ll/)
 * (@n0ll)
 * [4 years, 12 months ago](https://wordpress.org/support/topic/error-in-apache-logs-2/#post-14542777)
 * Just updated to 6.0.6, but still creates problems with the backend:
 * [php7:emerg] [pid 28054] [client 79.233.52.72:53544] PHP Parse error: syntax 
   error, unexpected ‘)’ in /var/www-server/photo/blog/wp-content/plugins/wplr-sync/
   classes/rest.php on line 374
 *  Thread Starter [opicron](https://wordpress.org/support/users/opicron/)
 * (@opicron)
 * [4 years, 12 months ago](https://wordpress.org/support/topic/error-in-apache-logs-2/#post-14542963)
 * It only happens on other rest api calls. Not during regular usage of the website.
 *  [Martin Junius](https://wordpress.org/support/users/n0ll/)
 * (@n0ll)
 * [4 years, 12 months ago](https://wordpress.org/support/topic/error-in-apache-logs-2/#post-14543115)
 * Rolled back to 5.1.8 for now as I needed to upload images to my website.
 *  Plugin Author [Jordy Meow](https://wordpress.org/support/users/tigroumeow/)
 * (@tigroumeow)
 * [4 years, 12 months ago](https://wordpress.org/support/topic/error-in-apache-logs-2/#post-14543619)
 * There is mystery here, guys; in fact, this issue is only experienced by a tiny
   percentage of my users (like 0.05%). It’s about the syntax, so it should be really
   easy to fix; but looking at the code, I really don’t see anything wrong at all.
 * Have you tried modifying the code?
 * Can you confirm that the code making this issue is this part?
 *     ```
       $wpdb->prepare(
           "SELECT p.ID, p.post_title, p.post_content as description, p.post_excerpt as caption, pm1.meta_value as alt, pm2.meta_value as path 
           FROM $wpdb->posts p 
           LEFT JOIN $wpdb->postmeta pm1 ON pm1.post_id = p.ID AND pm1.meta_key = '_wp_attachment_image_alt' 
           LEFT JOIN $wpdb->postmeta pm2 ON pm2.post_id = p.ID AND pm2.meta_key = '_wp_attached_file' 
           WHERE post_type='attachment' 
           AND post_status='inherit' 
           AND ID IN (" . $mediaIdsPlaceholders . ") 
           $orderSql 
           LIMIT %d, %d", array_merge( $mediaIds, array( $skip, $limit ) ),
         ), ARRAY_A
       );
       ```
   
 * Do you see anyway to change this so that it works for you? I feel blind, is there
   something I don’t see?
 * Are you all running PHP 7.2? I actually could only test this with 5.6, 7.3, 7.4
   and 8.0.
 * I also looked all over the web for similar issues and I found this: [https://wordpress.org/support/topic/syntax-error-php-7-2/](https://wordpress.org/support/topic/syntax-error-php-7-2/).
   And it was you [@opicron](https://wordpress.org/support/users/opicron/) 🙂
 * Oh wait, maybe it’s this… what happens if you remove the comma at the end of 
   this line?
 * > array_merge( $mediaIds, array( $skip, $limit ) )**,**
 * Normally, that’s completely fine, but this specific version of PHP with some 
   settings might break on it.
 *  [Creato](https://wordpress.org/support/users/creatomatic/)
 * (@creatomatic)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/error-in-apache-logs-2/#post-14569834)
 * [@tigroumeow](https://wordpress.org/support/users/tigroumeow/)
 * I had to fix this for a customer this morning as it breaks REST. You have a comma
   after array_merge() but there are no further arguments.
 * Best wishes,
 * James
 *  Plugin Author [Jordy Meow](https://wordpress.org/support/users/tigroumeow/)
 * (@tigroumeow)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/error-in-apache-logs-2/#post-14578702)
 * Hi,
 * I pushed a new release, it also fixes this permanently 🙂

Viewing 12 replies - 1 through 12 (of 12 total)

The topic ‘Error in Apache logs’ is closed to new replies.

 * ![](https://ps.w.org/wplr-sync/assets/icon-256x256.png?rev=1939787)
 * [Photo Engine (Media Organizer & Lightroom)](https://wordpress.org/plugins/wplr-sync/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wplr-sync/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wplr-sync/)
 * [Active Topics](https://wordpress.org/support/plugin/wplr-sync/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wplr-sync/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wplr-sync/reviews/)

 * 12 replies
 * 4 participants
 * Last reply from: [Jordy Meow](https://wordpress.org/support/users/tigroumeow/)
 * Last activity: [4 years, 11 months ago](https://wordpress.org/support/topic/error-in-apache-logs-2/#post-14578702)
 * Status: resolved