{"id":193,"date":"2020-12-10T12:00:00","date_gmt":"2020-12-10T12:00:00","guid":{"rendered":"https:\/\/molecularsciences.org\/content\/?p=193"},"modified":"2024-02-02T17:38:44","modified_gmt":"2024-02-02T22:38:44","slug":"installing-and-using-phpdocumentor-on-ubuntu","status":"publish","type":"post","link":"https:\/\/molecularsciences.org\/content\/installing-and-using-phpdocumentor-on-ubuntu\/","title":{"rendered":"Installing and using phpDocumentor on Ubuntu"},"content":{"rendered":"\n<p>phpDocumentor is a tool which creates complete documentation like Javadocs for PHP code.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Installing phpDocumentor<\/h2>\n\n\n\n<p>Install libraries.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt-get libapache2-mod-php5<\/code><\/pre>\n\n\n\n<p>Restart Apache.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo service apache2 restart<\/code><\/pre>\n\n\n\n<p>Install PEAR. PEAR is a repository of php extensions:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo pear config-set data_dir \/var\/www<\/code><\/pre>\n\n\n\n<p>Tell PEAR where to install phpDocumentor:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;br&gt;$ sudo pear install --alldeps phpDocumentor&lt;br&gt;<\/code><\/pre>\n\n\n\n<p>www-data is user Apache on Ubuntu:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo mkdir \/var\/www\/phpDocumentorOuput\nsudo chown www-data \/var\/www\/phpDocumentorOutput<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Using phpDocumentor<\/h2>\n\n\n\n<p>You can use phpDocumentor on commandline or via a web interface. For the web interface, type the following http:\/\/localhost\/phpDocumentor in your browser. Click on Files tab and provide address of the file or directory your intend to create documentation for. Then click on output and specify the output directory. Then hit create button.<\/p>\n\n\n\n<p><strong>On commandline:<\/strong><\/p>\n\n\n\n<p>Create an output directory and assign proper permissions:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo mkdir \/var\/www\/docs\nsudo chown my-user_account \/var\/www\/docs\nsudo 644 \/var\/www\/docs<\/code><\/pre>\n\n\n\n<p>Create documentation for one file:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\nphpdoc -d \/var\/www\/my_code_directory\/my_code.php -t \/var\/www\/docs<\/code><\/pre>\n\n\n\n<p>Create documentation all files in a directory and its subdirectories:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>phpdoc -d \/var\/www\/my_code_directory -t \/var\/www\/docs<\/code><\/pre>\n\n\n\n<p>Change the look of the documented code:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>phpdoc -o HTML:frames:earthli -d \/var\/www\/my_code_directory -t \/var\/www\/docs<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>phpDocumentor is a tool which creates complete documentation like Javadocs for PHP code. Installing phpDocumentor Install libraries. Restart Apache. Install PEAR. PEAR is a repository of php extensions: Tell PEAR where to install phpDocumentor: www-data is user Apache on Ubuntu: Using phpDocumentor You can use phpDocumentor on commandline or via a web interface. For the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":395,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[34,23],"tags":[82,35,24],"class_list":["post-193","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux","category-php","tag-installation-guide","tag-linux","tag-php"],"_links":{"self":[{"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/posts\/193","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/comments?post=193"}],"version-history":[{"count":2,"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/posts\/193\/revisions"}],"predecessor-version":[{"id":397,"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/posts\/193\/revisions\/397"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/media\/395"}],"wp:attachment":[{"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/media?parent=193"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/categories?post=193"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/tags?post=193"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}