{"id":258,"date":"2018-04-12T16:04:23","date_gmt":"2018-04-12T20:04:23","guid":{"rendered":"https:\/\/blog.beausanders.org\/?p=258"},"modified":"2018-08-07T10:31:40","modified_gmt":"2018-08-07T14:31:40","slug":"how-to-upgrade-autoindex-2-2-4-to-php-7-1","status":"publish","type":"post","link":"https:\/\/blog.beausanders.org\/index.php\/how-to-upgrade-autoindex-2-2-4-to-php-7-1\/","title":{"rendered":"How to Upgrade AutoIndex to PHP 7"},"content":{"rendered":"<p>I posted back in September 2017 that I am a fan of the AutoIndex 2.2.4 PHP script. See my post &#8220;<a href=\"https:\/\/blog.beausanders.org\/index.php\/bootstrap-3-responsive-template-for-autoindex-php-script\/\">Bootsrap 3 Responsive Template for AutoIndex PHP Script<\/a>&#8220;.<\/p>\n<p>Many ISPs and web designers are moving to PHP\u00a0 7.x, the current version of PHP.\u00a0 Unfortunately this causes AutoIndex 2.2.4 to stop working. It will throw an error referring to a magic_quotes function call on line 122 of the <code>index.php<\/code> file:<\/p>\n<p><code><b>Fatal error<\/b>: Uncaught Error: Call to undefined function set_magic_quotes_runtime()<\/code><\/p>\n<p>The magic_quotes function was taken out of PHP 7.x. But have no fear, it turns out that the solution is not too difficult.\u00a0\u00a0<!--more--><\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>\n<li>Make a backup copy of the original <code>index.php<\/code> in case something goes wrong.<\/li>\n<li>Open <code>index.php<\/code> in your editor and find lines 116 to 122 which should look like:<br \/>\n<code>if (@get_magic_quotes_gpc())<br \/>\n\/\/remove any slashes added by the \"magic quotes\" setting<br \/>\n{<br \/>\n$_GET = array_map('stripslashes', $_GET);<br \/>\n$_POST = array_map('stripslashes', $_POST);<br \/>\n}<br \/>\n@set_magic_quotes_runtime(0);<\/code><\/li>\n<li>Disable these lines by remarking them out with \/* at the beginning and *\/ at the end like this:<br \/>\n<code>\/* if (@get_magic_quotes_gpc())<br \/>\n\/\/remove any slashes added by the \"magic quotes\" setting<br \/>\n{<br \/>\n$_GET = array_map('stripslashes', $_GET);<br \/>\n$_POST = array_map('stripslashes', $_POST);<br \/>\n}<br \/>\n@set_magic_quotes_runtime(0); *\/<\/code><\/li>\n<li>Save the file and close your editor.<\/li>\n<li>Now flush your browser cache, run your AutoIndex page, and start testing.<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<p>This fix worked for me. I tested the change in Firefox, Chrome, Edge, and Internet Explorer. So far there have been no problems. Let me know if this works for you.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I posted back in September 2017 that I am a fan of the AutoIndex 2.2.4 PHP script. See my post &#8220;Bootsrap 3 Responsive Template for AutoIndex PHP Script&#8220;. Many ISPs and web designers are moving to PHP\u00a0 7.x, the current version of PHP.\u00a0 Unfortunately this causes AutoIndex 2.2.4 to stop working. It will throw an &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,43],"tags":[53,55,54],"class_list":["post-258","post","type-post","status-publish","format-standard","hentry","category-solutions-to-problems-i-found-helpful","category-themes-templates-and-mods","tag-autoindex","tag-magic_quotes","tag-php"],"_links":{"self":[{"href":"https:\/\/blog.beausanders.org\/index.php\/wp-json\/wp\/v2\/posts\/258","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.beausanders.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.beausanders.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.beausanders.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.beausanders.org\/index.php\/wp-json\/wp\/v2\/comments?post=258"}],"version-history":[{"count":23,"href":"https:\/\/blog.beausanders.org\/index.php\/wp-json\/wp\/v2\/posts\/258\/revisions"}],"predecessor-version":[{"id":287,"href":"https:\/\/blog.beausanders.org\/index.php\/wp-json\/wp\/v2\/posts\/258\/revisions\/287"}],"wp:attachment":[{"href":"https:\/\/blog.beausanders.org\/index.php\/wp-json\/wp\/v2\/media?parent=258"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.beausanders.org\/index.php\/wp-json\/wp\/v2\/categories?post=258"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.beausanders.org\/index.php\/wp-json\/wp\/v2\/tags?post=258"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}