0

So I need to make a contact form for my website with PHP. Why PHP? My dad said that our webhost only works with PHP and not Node.js or something else.

So I downloaded XAMPP and started the Apache server, googled localhost:80 and my website was shown. All good. I added the directory of my HTML, CSS, JS files to DocumentRoot and Directory in httpd.conf. Was that the right thing?

Then I looked at how to integrate PHP with Apache. Then I found out that I have to add this in httpd.conf.

LoadModule php_module "c:/php/php8apache2_4.dll"
<FilesMatch \.php$>
    SetHandler application/x-httpd-php
</FilesMatch>
PHPIniDir "C:/php"

But that didnt work for me because I couldnt start my apache server anymore.

The error log said that something was wrong in apache/htdocs/api.

I tried to find this directory and couldnt find api in htdocs. So now Im kinda overwhelmed.

Does anyone know what to do?

3
  • If you're overwhelmed, you might want to consider using a CMS (content management system). Your host probably has one or more available (e.g. WordPress). A CMS will allow you to focus on building your content, so you don't have to worry about Apache, PHP, Database(e.g. MySQL) intricacies etc. Commented Dec 4, 2022 at 19:46
  • @berend Nah, I dont think thats the solution. I mean yea I am overwhelmed but I still want to learn it. Thats why I asked here to find solutions for my problem. Commented Dec 4, 2022 at 19:57
  • 1
    If you downloaded xampp then it should all be set up with php configured already, you shouldn't need to do anything extra than what's there when it's first installed. Commented Dec 4, 2022 at 23:08

1 Answer 1

1

If you download XAMPP then it's already set up with php. You don't have to install php manually.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.