Title: Breaks php include
Last modified: September 27, 2016

---

# Breaks php include

 *  Resolved [johnflufin](https://wordpress.org/support/users/johnflufin/)
 * (@johnflufin)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/breaks-php-include/)
 * My custom theme has a config.php file that I add to header.php via php include.
   Since header.php and config.php reside in the same theme directory I use `<?php
   include("config.php") ?>` at the top of header.php. This has worked flawlessly
   for many years. But the latest WordPress SEO seems to break the php include causing
   the config.php file to not load. No error. Just nothing.
 * If I change the include to a fake path such as “abc/config.php” it returns the
   following errors
    - Warning: include(/myabsolutepath/wp-content/themes/mytheme/abc/config.php):
      failed to open stream: No such file or directory in /myabsolutepath/wp-content/
      themes/mytheme/header.php on line 2
    - Warning: include(): Failed opening ‘/myabsolutepath/wp-content/themes/mytheme/
      abc/config.php’ for inclusion (include_path=’/myabsolutepath/wp-content/plugins/
      wordpress-seo/vendor/yoast/api-libs/google:.:/usr/lib/php:/usr/local/lib/php’)
      in /myabsolutepath/wp-content/themes/mytheme/header.php on line 2
 * Especially note the second error. Looks like maybe WordPress SEO is doing some
   sort of intercept to add it’s contributions?
 * Since `include("config.php")` doesn’t return an error I assume that the file 
   is found but it’s contents are not included for some reason.
 * I fixed it by changing the include to use an absolute path `include(get_template_directory()."/
   config.php");` but seems strange to me that this is necessary.
 * Any idea what’s going on here?
    -  This topic was modified 9 years, 7 months ago by [johnflufin](https://wordpress.org/support/users/johnflufin/).

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

 *  Plugin Support [amboutwe](https://wordpress.org/support/users/amboutwe/)
 * (@amboutwe)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/breaks-php-include/#post-8228399)
 * Can you please submit that to our [GitHub repository for Yoast SEO](https://github.com/Yoast/wordpress-seo/issues)?
   Thanks!
 * If you have not submitted an issue previously, this [guide](https://kb.yoast.com/kb/how-to-write-a-good-bug-report/#utm_source=support&utm_medium=forum&utm_campaign=support-link)
   will help you submit a complete report which may result in a faster resolution.
 *  Thread Starter [johnflufin](https://wordpress.org/support/users/johnflufin/)
 * (@johnflufin)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/breaks-php-include/#post-8228815)
 * Sure thing. On a semi-related note the “Read this *before* you post!” pinned 
   post by Joost on your plugin support section links to a REALLY outdated forked
   version of WordPress SEO on GitHub. Otherwise I would have posted there already.
   Seems like that fork should be closed.

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

The topic ‘Breaks php include’ is closed to new replies.

 * ![](https://ps.w.org/wordpress-seo/assets/icon-256x256.gif?rev=3419908)
 * [Yoast SEO - Advanced SEO with real-time guidance and built-in AI](https://wordpress.org/plugins/wordpress-seo/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wordpress-seo/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wordpress-seo/)
 * [Active Topics](https://wordpress.org/support/plugin/wordpress-seo/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wordpress-seo/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wordpress-seo/reviews/)

## Tags

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

 * 2 replies
 * 2 participants
 * Last reply from: [johnflufin](https://wordpress.org/support/users/johnflufin/)
 * Last activity: [9 years, 7 months ago](https://wordpress.org/support/topic/breaks-php-include/#post-8228815)
 * Status: resolved