CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Installing CiviCRM »
  • WordPress Installations (Moderators: Kurund Jalmi, Coleman Watts) »
  • [solved] T_STRING Error in civicrm.settings.php when using WampServer
Pages: [1]

Author Topic: [solved] T_STRING Error in civicrm.settings.php when using WampServer  (Read 3971 times)

aglozier

  • I post frequently
  • ***
  • Posts: 135
  • Karma: 9
    • Phoenix Academy
  • CiviCRM version: 4.7.9
  • CMS version: WordPress 4.6.1
  • MySQL version: 5.7.14
  • PHP version: 5.6.21
[solved] T_STRING Error in civicrm.settings.php when using WampServer
December 30, 2012, 12:36:19 pm
I've been trying to get to setup a test environment on my PC using WampServer.  Today I finally got it to work.  However, I encountered an error in the civicrm.settings.php file.  I had to manually edit to it to get CiviCRM to run.

For my testing I used fresh installs of the latest versions of WordPress (3.5) and CiviCRM (4.2.6).  CiviCRM installed correctly but I got the following error when I tried to run it.

       Parse error: syntax error, unexpected T_STRING in C:\wamp\www\wordpress\wp-content\plugins\civicrm\civicrm.settings.php on line 136

Lines 135 and line 136 of civicrm.settings.php are:

Code: [Select]
$civicrm_root = 'C:\wamp\www\wordpress/wp-content/plugins\civicrm\civicrm\';
define( 'CIVICRM_TEMPLATE_COMPILEDIR', 'C:\\wamp\\www\\wordpress/wp-content/plugins\\files\\civicrm\\templates_c\\' );

The above is a curious blend of slashes, back-slashes and double back-slashes.  Windows uses back-slashes.  However changing everything to backslashes did not fix the problem.  I'm not a PHP programer so I had to read up on string syntax (http://php.net/manual/en/language.types.string.php) to figure this out.  It turns out the problem is in line 135 with the " \' ".

Here's the fixed code:

Code: [Select]
$civicrm_root = 'C:\wamp\www\wordpress\wp-content\plugins\civicrm\civicrm\\';
define( 'CIVICRM_TEMPLATE_COMPILEDIR', 'C:\wamp\www\wordpress\wp-content\plugins\files\civicrm\templates_c\\' );

You have to use backslashes everywhere except before a single quote where you need to use a double back-slash.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Installing CiviCRM »
  • WordPress Installations (Moderators: Kurund Jalmi, Coleman Watts) »
  • [solved] T_STRING Error in civicrm.settings.php when using WampServer

This forum was archived on 2017-11-26.