{"id":1710,"date":"2025-12-22T23:55:21","date_gmt":"2025-12-22T21:55:21","guid":{"rendered":"https:\/\/www.shukko.com\/x3\/?p=1710"},"modified":"2025-12-22T23:55:21","modified_gmt":"2025-12-22T21:55:21","slug":"directadmin-which-site-uses-which-version-of-php-bash-script","status":"publish","type":"post","link":"https:\/\/www.shukko.com\/x3\/2025\/12\/22\/directadmin-which-site-uses-which-version-of-php-bash-script\/","title":{"rendered":"directadmin which site uses which version of php bash script"},"content":{"rendered":"\n<pre class=\"wp-block-code\"><code>#!\/bin\/bash\n#*******************************************************************************\n#* @file        php_list.sh\n#*\n#* @brief       This scripts creates an list with used php versions for each domain on DA\n#*\n#*\n#* @author \tJordi van Nistelrooij @ Webs en Systems. \n#* @email \tinfo@websensystems.nl\n#* @website\thttps:\/\/websensystems.nl\n#* @version \t1.0.0\n#* @copyright \tNon of these scripts maybe copied or modified without permission of the author\n#*\n#* @date        2025-06-10\n#*\n#*******************************************************************************\nDA_USERS=\"\/usr\/local\/directadmin\/data\/users\"\nOPTIONS_CONF=\"\/usr\/local\/directadmin\/custombuild\/options.conf\"\nOUTPUT_FILE=\"php_versies_per_domein.txt\"\n\n# Haal phpX_release waardes op uit options.conf\ndeclare -A php_versions\nfor i in {1..4}; do\n    versie=$(grep \"^php${i}_release=\" \"$OPTIONS_CONF\" | cut -d= -f2)\n    if &#91; -n \"$versie\" ]; then\n        php_versions&#91;\"$i\"]=\"$versie\"\n    fi\ndone\n\necho \"Domein | Gekozen PHP Slot | PHP Versie\" > \"$OUTPUT_FILE\"\necho \"------------------------------\" >> \"$OUTPUT_FILE\"\n\nfor user in $(ls \"$DA_USERS\"); do\n    DOMAINS_FILE=\"$DA_USERS\/$user\/domains.list\"\n\n    if &#91; -f \"$DOMAINS_FILE\" ]; then\n        for domain in $(cat \"$DOMAINS_FILE\"); do\n            CONF_FILE=\"$DA_USERS\/$user\/domains\/${domain}.conf\"\n            if &#91; ! -f \"$CONF_FILE\" ]; then\n                continue\n            fi\n\n            SLOT=$(grep \"^php1_select=\" \"$CONF_FILE\" | cut -d= -f2)\n\n            if &#91; -z \"$SLOT\" ]; then\n                SLOT=\"1\"  # fallback naar php1 als er geen php1_select is\n            fi\n\n            VERSION=\"${php_versions&#91;$SLOT]:-(onbekend)}\"\n\n            echo \"$domain | $SLOT | $VERSION\" >> \"$OUTPUT_FILE\"\n        done\n    fi\ndone\n\ncolumn -t -s '|' \"$OUTPUT_FILE\"\n\n\nexit<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1710","post","type-post","status-publish","format-standard","hentry","category-kategerisiz"],"_links":{"self":[{"href":"https:\/\/www.shukko.com\/x3\/wp-json\/wp\/v2\/posts\/1710","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.shukko.com\/x3\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.shukko.com\/x3\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.shukko.com\/x3\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.shukko.com\/x3\/wp-json\/wp\/v2\/comments?post=1710"}],"version-history":[{"count":1,"href":"https:\/\/www.shukko.com\/x3\/wp-json\/wp\/v2\/posts\/1710\/revisions"}],"predecessor-version":[{"id":1711,"href":"https:\/\/www.shukko.com\/x3\/wp-json\/wp\/v2\/posts\/1710\/revisions\/1711"}],"wp:attachment":[{"href":"https:\/\/www.shukko.com\/x3\/wp-json\/wp\/v2\/media?parent=1710"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.shukko.com\/x3\/wp-json\/wp\/v2\/categories?post=1710"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.shukko.com\/x3\/wp-json\/wp\/v2\/tags?post=1710"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}