Title: &#039;endwhile&#039; (T_ENDWHILE) &amp; wp_enqueue_script Error
Last modified: August 22, 2016

---

# 'endwhile' (T_ENDWHILE) & wp_enqueue_script Error

 *  [tekehe](https://wordpress.org/support/users/tekehe/)
 * (@tekehe)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/endwhile-t_endwhile-wp_enqueue_script-error/)
 * I tried to wordpress transferred to VPS (environment: Nginx + Ubuntu 14 + PHP5-
   fpm)
 * But it does not work wordpress. 3 tips to get the following error:
 * 1: Notice:… Wp_enqueue_script was called incorrectly Scripts and styles should
   not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts,
   or login_enqueue_scripts hooks Please see Debugging in WordPress for more information(.
   This message was added in version 3.3) in / var /…../wp-includes/functions.php
   on line 3370
 * 2: Parse error: syntax error, unexpected ‘endwhile’ (T_ENDWHILE) in /var/…../
   wp-content/themes/……/single.php on line 97
    Code Here: [http://pastebin.com/pCCmBp6n](http://pastebin.com/pCCmBp6n)
 * 3: Deprecated: Function ereg_replace () is deprecated in /var/……../wp-content/
   plugins/popularity-contest/popularity-contest.php on line 2572
    Code Here: [http://pastebin.com/LcnqMhDn](http://pastebin.com/LcnqMhDn)
 * How to resolve these errors? Thanks!!

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

 *  Thread Starter [tekehe](https://wordpress.org/support/users/tekehe/)
 * (@tekehe)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/endwhile-t_endwhile-wp_enqueue_script-error/#post-5362512)
 * No one can help me?
 *  Thread Starter [tekehe](https://wordpress.org/support/users/tekehe/)
 * (@tekehe)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/endwhile-t_endwhile-wp_enqueue_script-error/#post-5362536)
 * Correction:
 * 1: Notice:… Wp_enqueue_script was called incorrectly Scripts and styles should
   not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts,
   or login_enqueue_scripts hooks Please see Debugging in WordPress for more information(.
   This message was added in version 3.3) in / var /…../wp-includes/functions.php
   on line 3370
 * code：trigger_error( sprintf( __( ‘%1$s was called **incorrectly**. %2$s %3$s’),
   $function, $message, $version ) );
 * 2: Parse error: syntax error, unexpected ‘endwhile’ (T_ENDWHILE) in /var/…../
   wp-content/themes/……/single.php on line 40
    single.php code: [http://pastebin.com/pCCmBp6n](http://pastebin.com/pCCmBp6n)
 * 3: Deprecated: Function ereg_replace () is deprecated in /var/……../wp-content/
   plugins/popularity-contest/popularity-contest.php on line 2590
    popularity-contest.
   php : [http://pastebin.com/LcnqMhDn](http://pastebin.com/LcnqMhDn)

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

The topic ‘'endwhile' (T_ENDWHILE) & wp_enqueue_script Error’ is closed to new replies.

## Tags

 * [t_endwhile](https://wordpress.org/support/topic-tag/t_endwhile/)
 * [wp_enqueue_script](https://wordpress.org/support/topic-tag/wp_enqueue_script/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 1 participant
 * Last reply from: [tekehe](https://wordpress.org/support/users/tekehe/)
 * Last activity: [11 years, 7 months ago](https://wordpress.org/support/topic/endwhile-t_endwhile-wp_enqueue_script-error/#post-5362536)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
