Enabling PHP

Avatar
  • updated
  • Answered

Simple question (I think) I have a domain, *******.net, and have set up photos.*******.net. to display award photos from some dog shows.  I would like to enable PHP processing in this so I can automatically generate index pages of the photos.  I believe I have set the PHP version for this domain to 8.1. What do I need in my .htaccess file to let htm files use PHP?  Where does this .htaccess file need to be?


I'm very rusty on all of this, I haven't done any web development for about 15 years.

Thanks

Avatar
IMH Support Agent 2
Quote from Alan Folsom

Thank you.  I will look into Softaculous.  I've already uploaded the images. What I used to do in the old days was embed PHP into HTML files with <?php and so forth. What I would like to do is have one file that will look up available .jpg files in the folder, and produce A preview index page for all of them.  How do I tell my domain, presumably via .htaccess to process .htm files for embedded PHP?

Hello Alan,


It sounds like you're trying to parse .htm files for embedded PHP.  You can set an add handler in .htaccess to ensure that .htm or .html files are processed for PHP.  You can see how this is done in this Stackoverflow answer. I hope this helps answer your question and solve your problem!  

If you continue to have problems with this issue, I would recommend trying to respond to the community forum I've linked.

If you have any further questions or comments, please let us know.


Kindest Regards,

Arnel C.

Avatar
Alan Folsom

Thank you.  I will look into Softaculous.  I've already uploaded the images. What I used to do in the old days was embed PHP into HTML files with <?php and so forth. What I would like to do is have one file that will look up available .jpg files in the folder, and produce A preview index page for all of them.  How do I tell my domain, presumably via .htaccess to process .htm files for embedded PHP?

Avatar
IMH Support Agent 1
  • Answered

Hello,

Thank you for contacting us about enabling PHP. PHP is enabled by default on all of our servers, you can use a phpinfo page to verify this. If you just want to share images you can upload them using cPanel or FTP and then navigate directly to the image address. For example, if you upload an image titled "dogshow1.jpg" to the document root for photos.folsoms.net you can view them by navigating to:

photos.*******.net/dogshow1.jpg

After uploading, you could also embed images using HTML.

Another option is to use an Image Gallery software that can easily be installed using Softaculous. You can view the available options by logging into cPanel and clicking Softaculous Apps Installer in the Software section, then clicking the Image Galleries link in the left menu. There are many to choose from and but these would help you manage your images. Let us know if you have any further questions.

Thank you,

John-Paul