Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Ookma-Kyi's avatar

Documention for PHP Projects

Hello,

I am trying to set up PHPStorm 2023.3.6 to use phpDocumentator 3.7.3, and I am having issues. For starters, there is no phpDocumentor plugin to make this easier. Second when I run phpDocumentator I get the warning [warning] Your documentationset seems to be empty!. I have it setup to run as an external tool:

Program: php
Parameters: C:/Laragon//bin/phpdocumentator/phpdocumentator.phar --config="$ProjectFileDir$/phpdoc.dist.xml"
Working directory: C:/Laragon//bin/phpdocumentator/

Here is my phpdoc.dist.xml:

<?xml version="1.0" encoding="UTF-8" ?>
<phpdoc>
    <title>${PROJECT_NAME}</title>
    <parser>
        <target>phpdocs/output</target>
        <extensions>
            <extension>module</extension>
            <extension>inc</extension>
            <extension>php</extension>
        </extensions>
    </parser>
    <transformer>
        <target>phpdocs/docs</target>
    </transformer>
    <files>
        <ignore>tests/*</ignore>
        <ignore>Tests/*</ignore>
    </files>
</phpdoc>

I have already tried to consort with Larry, but he gave me instructions to a non-existent setting panel. My project does have documentation all over the place, and is using the proper syntax as shown on my repository. Any ideas?

0 likes
2 replies
LaryAI's avatar
Level 58

It seems like you're having trouble with phpDocumentor not recognizing your source files. The configuration file looks mostly correct, but there are a couple of things you might want to check or adjust:

  1. Ensure that the <files> section in your phpdoc.dist.xml file is correctly set up to include your source files. You need to specify the directory or files you want to document. If you don't include any <directory> tags, phpDocumentor won't know where to look for your files.

  2. The <ignore> tags are correct, but they only work if the <files> section is properly set up.

Here's an updated version of your phpdoc.dist.xml that includes a <directory> tag:

<?xml version="1.0" encoding="UTF-8" ?>
<phpdoc>
    <title>${PROJECT_NAME}</title>
    <parser>
        <target>phpdocs/output</target>
        <extensions>
            <extension>module</extension>
            <extension>inc</extension>
            <extension>php</extension>
        </extensions>
    </parser>
    <transformer>
        <target>phpdocs/docs</target>
    </transformer>
    <files>
        <directory>src</directory> <!-- Adjust this path to point to your source code directory -->
        <ignore>tests/*</ignore>
        <ignore>Tests/*</ignore>
    </files>
</phpdoc>

Make sure to replace <directory>src</directory> with the actual path to your source code. If your source code is in the root of your project, you might use <directory>.</directory>.

  1. Check the Parameters in your PHPStorm external tool configuration. The path to phpdocumentator.phar should be relative to the Working directory or an absolute path. Also, ensure that there are no double slashes (//) in your paths. Here's a corrected version:
Program: php
Parameters: C:/Laragon/bin/phpdocumentator/phpdocumentator.phar --config="$ProjectFileDir$/phpdoc.dist.xml"
Working directory: C:/Laragon/bin/phpdocumentator/

After making these changes, try running phpDocumentor again. If you still encounter issues, verify that the paths in your phpdoc.dist.xml are correct and that your source files contain proper docblock comments for phpDocumentor to process.

Please or to participate in this conversation.