diff --git a/build.xml b/build.xml
index 12b877e6890a925ece83a1dd2a154413c05f2408..e25aabfa474fd94ea59ea9864315bc75d16b7567 100644
--- a/build.xml
+++ b/build.xml
@@ -27,6 +27,7 @@
   <property name="snooze_multiplier" value="1" /><!-- can be used to slow down tests (selenium only) -->
   <property name="solr_startup_sleep" value="0" />
   <property name="solr_version" value="7.3.1" />
+  <property name="skip_phpdoc" value="false" />
   <property name="phpdoc_version" value="2.9.0" />
 
   <property name="version" value="6.0" />
@@ -139,30 +140,36 @@
 
   <!-- PHP API Documentation -->
   <target name="phpdoc">
-    <!-- GET phpDocumentor.phar -->
+    <!-- Skip the whole phpdoc task when disabled -->
     <if>
-      <not><available file="${srcdir}/vendor/bin/phpDocumentor-${phpdoc_version}.phar" /></not>
+      <not><istrue value="${skip_phpdoc}" /></not>
       <then>
-        <httpget followRedirects="true" url="https://github.com/phpDocumentor/phpDocumentor2/releases/download/v${phpdoc_version}/phpDocumentor.phar" dir="${srcdir}/vendor/bin" filename="phpDocumentor-${phpdoc_version}.phar" />
-        <chmod mode="0755">
-          <fileset dir="${srcdir}/vendor/bin">
-            <include name="phpDocumentor-${phpdoc_version}.phar" />
+        <!-- GET phpDocumentor.phar -->
+        <if>
+          <not><available file="${srcdir}/vendor/bin/phpDocumentor-${phpdoc_version}.phar" /></not>
+          <then>
+            <httpget followRedirects="true" url="https://github.com/phpDocumentor/phpDocumentor2/releases/download/v${phpdoc_version}/phpDocumentor.phar" dir="${srcdir}/vendor/bin" filename="phpDocumentor-${phpdoc_version}.phar" />
+            <chmod mode="0755">
+              <fileset dir="${srcdir}/vendor/bin">
+                <include name="phpDocumentor-${phpdoc_version}.phar" />
+              </fileset>
+            </chmod>
+          </then>
+        </if>
+        <!-- Run phpdoc -->
+        <mkdir dir="${builddir}/apidocs" />
+        <!-- Old embedded version; no longer works correctly...
+        <phpdoc2 title="VuFind API Documentation"
+          pharlocation="${srcdir}/vendor/bin/phpDocumentor-${phpdoc_version}.phar"
+          destdir="${builddir}/apidocs">
+          <fileset dir=".">
+            <include name="module/*/src/**/*.php" />
           </fileset>
-        </chmod>
+        </phpdoc2>
+        -->
+        <exec command="php ${srcdir}/vendor/bin/phpDocumentor-${phpdoc_version}.phar --title=&quot;VuFind API Documentation&quot; -t ${builddir}/apidocs -d ${srcdir}/module" passthru="true" />
       </then>
     </if>
-    <!-- Run phpdoc -->
-    <mkdir dir="${builddir}/apidocs" />
-    <!-- Old embedded version; no longer works correctly...
-    <phpdoc2 title="VuFind API Documentation"
-      pharlocation="${srcdir}/vendor/bin/phpDocumentor-${phpdoc_version}.phar"
-      destdir="${builddir}/apidocs">
-      <fileset dir=".">
-        <include name="module/*/src/**/*.php" />
-      </fileset>
-    </phpdoc2>
-    -->
-    <exec command="php ${srcdir}/vendor/bin/phpDocumentor-${phpdoc_version}.phar --title=&quot;VuFind API Documentation&quot; -t ${builddir}/apidocs -d ${srcdir}/module" passthru="true" />
   </target>
 
   <!-- PHPUnit -->