Title: php.ini &gt; auto_prepend_file causes parse error
Last modified: October 24, 2016

---

# php.ini > auto_prepend_file causes parse error

 *  Resolved [nipponese](https://wordpress.org/support/users/nipponese/)
 * (@nipponese)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/php-ini-auto_prepend_file-causes-parse-error/)
 * I am attempting to setup Wordfence WAF.
 * I have created wordfence-waf.php in the root of the WP installation, and set 
   permissions to 775, in addition to chgrp to the web group.
 * I’m using host that allows for creation of an additional php.ini that is parsed
   in addition to the system php.ini, but does not allow exiting on system php.ini.
 * There doesn’t seem to be a problem reading the custom php.ini, but when applying
   it, I get a PHP parse error:
 * `Parse error: syntax error, unexpected 'not' (T_STRING) in /home/public/wordfence-
   waf.php on line 3`.
 * The auto_prepend_file directive is the only item in this custom php.ini:
 *     ```
       $ cat php.ini 
       auto_prepend_file = '/home/public/wordfence-waf.php'
       ```
   
 * Additionally, I tried adding the following to my WP root .htaccess and the warning
   message did not go away:
 *     ```
       <IfModule lsapi_module>
         php_value auto_prepend_file '/home/public/wordfence-waf.php'
       </IfModule>
       ```
   
 * Using WordPress 4.6.1, Wordfence 6.2.2 and PHP 5.6.27.

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

 *  Thread Starter [nipponese](https://wordpress.org/support/users/nipponese/)
 * (@nipponese)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/php-ini-auto_prepend_file-causes-parse-error/#post-8350320)
 * Just incase there was any question about the location of wordfence-waf:
 *     ```
       $ ls -lart | grep 'wordfence-waf.php'
       -rwxrwxr-x   1 <userid>  web       342 Oct 24 20:53 wordfence-waf.php
       ```
   
 *  [wfasa](https://wordpress.org/support/users/wfasa/)
 * (@wfasa)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/php-ini-auto_prepend_file-causes-parse-error/#post-8352529)
 * Hi!
    the “Parse error: syntax error, unexpected ‘not'” error indicates that the
   actual PHP code in that file is broken. I suggest you make sure that you actually
   pasted the full code in to wordfence-waf.php.
 *  Thread Starter [nipponese](https://wordpress.org/support/users/nipponese/)
 * (@nipponese)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/php-ini-auto_prepend_file-causes-parse-error/#post-8355058)
 * Here’s what I have in wordfence-waf.php:
 *     ```
       $ cat wordfence-waf.php 
       <?php
       // Before removing this file, please verify the PHP ini setting <code>auto_prepend_file</code> 
       does not point to this.
   
       if (file_exists('/home/public/wp-content/plugins/wordfence/waf/bootstrap.php')) {
       	define("WFWAF_LOG_PATH", '/home/public/wp-content/wflogs/');
       	include_once '/home/public/wp-content/plugins/wordfence/waf/bootstrap.php';
       }
       ?>
       ```
   
 *  Thread Starter [nipponese](https://wordpress.org/support/users/nipponese/)
 * (@nipponese)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/php-ini-auto_prepend_file-causes-parse-error/#post-8355077)
 * Ah, I totally see the problem now. When I pasted the code in wordfence-waf.php,
   the soft-wrap on the comment copy-pasted as a carriage return and php was choking
   on that.
 * I removed the carriage return and everything works as expected.
 *  [wfasa](https://wordpress.org/support/users/wfasa/)
 * (@wfasa)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/php-ini-auto_prepend_file-causes-parse-error/#post-8355143)
 * Great! Thanks for checking back in.

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

The topic ‘php.ini > auto_prepend_file causes parse error’ is closed to new replies.

 * ![](https://ps.w.org/wordfence/assets/icon.svg?rev=2070865)
 * [Wordfence Security - Firewall, Malware Scan, and Login Security](https://wordpress.org/plugins/wordfence/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wordfence/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wordfence/)
 * [Active Topics](https://wordpress.org/support/plugin/wordfence/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wordfence/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wordfence/reviews/)

## Tags

 * [php.ini](https://wordpress.org/support/topic-tag/php-ini/)
 * [wordfence-waf](https://wordpress.org/support/topic-tag/wordfence-waf/)

 * 5 replies
 * 2 participants
 * Last reply from: [wfasa](https://wordpress.org/support/users/wfasa/)
 * Last activity: [9 years, 7 months ago](https://wordpress.org/support/topic/php-ini-auto_prepend_file-causes-parse-error/#post-8355143)
 * Status: resolved