bryanlittlefield / TUGBOAT

The straight to code approach for dev environments
GNU General Public License v3.0
6 stars 5 forks source link

Add SimpleXML #83

Open bryanlittlefield opened 1 year ago

bryanlittlefield commented 1 year ago

Install SimpleXML PHP Extension

ERROR: PHP_CodeSniffer requires the tokenizer, xmlwriter and SimpleXML extensions to be enabled. Please enable xmlwriter and SimpleXML. SyntaxError: Unexpected token E in JSON at position 0

GitHub Copilot Response

GitHub Copilot: The error message indicates that the PHP_CodeSniffer tool requires the tokenizer, xmlwriter, and SimpleXML extensions to be enabled in PHP, but they are not currently enabled. The error message also suggests that the xmlwriter and SimpleXML extensions need to be enabled.

To resolve this error, you need to enable the tokenizer, xmlwriter, and SimpleXML extensions in your PHP configuration. Here are the steps to enable these extensions:

  1. Locate your php.ini file. This file is typically located in the php directory of your PHP installation.

  2. Open the php.ini file in a text editor.

  3. Search for the following lines:

    ;extension=tokenizer
    ;extension=xmlwriter
    ;extension=simplexml
  4. Remove the semicolon (;) from the beginning of each line to enable the extensions:

    extension=tokenizer
    extension=xmlwriter
    extension=simplexml
  5. Save the php.ini file and restart your web server or PHP process.

After enabling the tokenizer, xmlwriter, and SimpleXML extensions, you should be able to run PHP_CodeSniffer without encountering the error message.

bryanlittlefield commented 1 year ago

Fix :

Add docker-php-ext-install simplexml to the Dockerfile for TUGBOAT-PHP