In my previous post, I was unable to install PHP & MySQL. This time after 2 years, I tried again but still fail, so I decided to use XAMPP to install PHP & MySQL and Apache on MacOS Ventura and it works!
But I had to disable default installed apache2 and change MySQL default port at XAMPP before MySQL and Apache2 can run on XAMPP.
How To Install PHP, MySQL & Apache using XAMPP
1. Download and install XAMPP
Mount the xampp dmg and run it. If you face unknown publish then do Control + Click on the XAMPP installer then run it again.
2. Follow the step by step instruction in installing XAMPP
Just follow the instructions.
3. Run the servers
If you unable to run the MySQL & Apache web server than follow below solution.
xampp macos ventura – mysql and apache webserver unable to start
If you can run MySQL change it default ports. I use 3316 instead of default 3306.
xampp macos ventura – change the default port to 3316
I tried to stop mysql service but MacOS informed no MySQL service was running. Only by changing MySQL default port it works.
xampp macos ventura – mysql not running
If you can’t run the apache2 server, stop default apache2 server by typing at the terminal.
stop apache2
1
sudo apachectl stop
Then run again Apache Web Server at XAMPP.
xamp macos ventura – apache webserver now running
4. Test PHP & MySQL by accessing PhpMyAdmin
If you can access phpMyAdmin and create table or user from phpMyAdmin then your XAMPP installation works!
xampp macos ventura – access localhost and click phpmyadminxamp macos ventura – successful installed php and mysql now can access phpmyadmin
My Steps Installing Nodejs using Node Version Manager (nvm)
1) Firstly list the node version you want to install
nvm list remote
1
nvm ls-remote
ubuntu 22 – choose node version
2) Secondly, choose the version you want to install. I chose LTS v18 @ lts/hydrogen
node install hydrogen
1
nvm install lts/hydrogen
ubuntu 22 – install node v 18
3) Check if you have installed the right version.
node version
1
node-v
ubuntu 22 – successfully installed node v18
If You Got Checksum Error
At first, I had the checksum error, when I checked on the internet it was due to curl installed using SNAP (which I did). I have to re-install my curl using APT and remove the snap path from the path environment.
ubuntu 22 – install node v 18
Curl still point to snap/bin.
1
curl
ubuntu 22 – curl still point to snap
1
echo$PATH
ubuntu 22 – installing node problem due to curl installed by snap
Remove the snap/bin from the environment. Edit it using nano
For this demo, you just submit the form by clicking “Submit form”. If you do the the hCaptcha correctly you will get hCaptcha success if not hCaptcha fail.
You can do your programming logic based on the success status.
Check the hCaptcha is ticked or no
There 2 methods to do this
Check the post value of ‘h-captcha-response’
Use data-callback
Method #1: Check the post value of ‘h-captcha-response’
The problem with the form as it is, if a user doesn’t do the hCaptcha test, the user still can submit the form. So we need to add javascript checking on the client side to check whether the user has done the captcha test or no.
If you have done the captcha test, hCaptcha will send a string of response in the $_POST[‘h-captcha-response’]. If not this string will be empty.
I want to center the text horizontally with top margin I tried few options example text-align: center; but it doesn’t work.
So below is the solution:
The CSS to Align Center the Text
CSS text align center with top margin
1
2
3
4
5
6
7
8
9
10
11
12
<style>
.align-center-with-top-margin{
/*u can change the top margin*/
top:18%;
/* to make text align center */
left:50%;
transform:translate(-50%,-50%);
margin:0;
width:100%;
}
</style>
The HTML Code
html code align center with top margin
1
2
3
<div class="align-center-with-top-margin">
Undangan
</div>
The Output of Text Align Center with Top Margin
css text align center horizontally with top margin – 8 characterscss text align center horizontally with top margin – 14 characterscss text align center horizontally with top margin – 15 characters
I want to switch my WordPress theme dynamically where if my visitor visits a specific URL they will see different theme while my main theme is still the same for other URLs.
All Other Pages will Show Main Theme Like Below
wordpress switch theme dynamically – original theme
Only for Page wordpress-how-to-switch-theme-dynamically-by-url/ will show below Theme
wordpress switch theme dynamically – different theme based on url
WordPress Hook to Change the Theme
You can do it by using pre_option_{$option} hook. In this case:
1
2
pre_option_stylesheet
pre_option_template
This hook will filter the value of an existing option before it is retrieved.