How to Setup WordPress on Raspberry Pi
HTML-код
- Опубликовано: 14 окт 2024
- Learn how to host a WordPress website on your Raspberry Pi 4 in this video tutorial that will show you how to install and configure WordPress and the database.
Get a Raspberry Pi 4 on Amazon 👉 amzn.to/2Ka0swl
Code snippets and more at tonyteaches.te...
Check out my vlog channel @TonyFlorida
#raspberrypi #wordpress
Thanks Tony I just got my first ever pi and I don’t know how to use it but I guess I’ll learn as I go. You earned a new sub
Awesome to hear it Joe. You will have fun with it
Simple and easy. Thank you for this content.
You bet!
Amazing teaching skills Tony keep up the good work
Best Rpi WP tutorial I've come across. You have yourself a new subscriber :)
Wow thanks! Welcome aboard
Learning tons!!! Love this! Keep up the awesome tutorials!!!! You rock!
Thank you! Will do!
You just earned a Sub. This was clear and detailed. Thank you
Thanks for the sub Nicholas!
It worked! Great video and clearly explained. Thank you for your work. Now if I could get my picamera v3 to stream on a wordpress page. Any thoughts?
spectacular, sensational. Congratulations, working perfectly in 2024
Thanks for this - it worked great for me. Any advice on how to troubleshoot suddenly not being able to connect to your web server? I've checked that nginx is still running and yet my other devices are telling me the server refuses to connect.
Very nicely explained Thank You
You are welcome
Thank you. awesome tutorials
Mr. Tony Florida for President! 👨💼🇺🇸 Awsome content again. Amazing! Thank You Sir!
😊 thank you very much
Thanks for youre videos bro they are awesome!
Thank you for sharing knowledge =D
I have just tried this out on a 3b and it worked 1st time, thank you very much, you just got sub'd.
Awesome! Thank you for subscribing Mark :)
Very clear, thanks!
Thanks!
Hi, I would like to appreciate this interesting video with all the contents. I am new to this technology and I have configure my raspberry pi 4 exacly as instructed on this video. unfortunatly I am running an error "nginx/1.18.0 502 Bad Gateway" as I reproduced exacly what Tony did I should get the same result. Please I need help what can I do to fix this error.
You probably use different version of php. Try to change the php version from 7.3 - 7.4(which is the latest for that moment) in the wordpress.conf file in this line:
server unix:/var/run/php/php7.3-fpm.sock;
Should be:
server unix:/var/run/php/php7.4-fpm.sock;
@@selfinit2416 thank you, helped to fix my problem!
Same here... Did you find a fix?
@@selfinit2416 I tried this and didnt work...
ruclips.net/video/hYVriHb43wU/видео.html
can you teach me how to change the upload theme volumn please ? i do exactly like your tutor but each time a tried to install a new theme by wordpress, it direct me to 413 (413 Request Entity Too Large). Thank you so much
php.init
upload_max_filesize = 64M
post_max_size = 64M
max_execution_time = 300
Hey Tony!
So Oracle is giving 4 core 24gb ARM servers in their always free packages
I tried following this video since both are ARM based, and up until the 10 min mark in the video, everything was smooth, however when I did try to load it via IP, I couldn't
Could you please make a tutorial on setting up the always free arm based server on oracle for WordPress?
Thanks!
Please send me a link to the free oracle offer
@@TonyTeachesTech www.oracle.com/uk/cloud/free/
@@TonyTeachesTech sorry for the late response, don't think I got a notification
First of all I just wanted to say THANK YOU and subbed!!
I have a problem: when I type in the IP address, images and the admin bar load up properly, but when I try to go to my domain, the image is broken and no admin bar shows up. Any idea what could be causing this?
i followed exactly when i look up ip just get bad gateway help pleas
Same. Got bad gateway. Hmmm
hi man i had the same issue but my friend helped me when you copy the config you have to edit the config so the version in config matches urs dont thank me thank marcos
@@IMAGINE-d8r thx man, its works.
This is such a great video. Is there a program you can use to just browse the database separately from visiting the wp-admin in a web browser? Thanks
You can use phpmyadmin to browse the database
@@TonyTeachesTech thanks
@@TonyTeachesTech also, do you know of a good way to browse it on a headless OS?
@@nicholassmith6412 the easiest for beginners is to access it with a web browser. Otherwise, you'll have to execute mysql commands to interact with the database
hey Tony. Thanks for the video. I have followed all the steps but when i tried to reload nginx i got the output: nginx.service is not active, cannot reload. what should i do here?
run; sudo systemctl enable nginx && sudo systemctl start nginx
So when I have made my site how do I publish it to the www?
Awelsome tutorial, keep up 👍
Thanks a lot!
Hi man, first of all thanks a lot! But can you help me with the question, how to move an existing wordpress site to a host (for example raspberry nginx like in one of your previous videos? Thanks in advance and best regards
This is my recommendation ruclips.net/video/JsQTkyHDvz0/видео.html
Hello sir, I have problem in browser: 502 Bad Gateway nginx/1.18.0.
Do you know what should I do ?
same here, did you find a fix?
ruclips.net/video/hYVriHb43wU/видео.html
@@Loveparaeveryone
pstream wp-php-handler {
server unix:/var/run/php/php8.2-fpm.sock;
}
server {
listen 80;
server_name _;
root /var/www/wordpress/;
index index.php;
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass wp-php-handler;
}
}
Hi Tony! Thanks for a great video on installing wordpress! How ever I ran into some problems with the config file and php config. I'm using Apache2 and as I reload it, Apache2 fails to start.
"apache2: Syntax error on line 225 of /etc/apache2/apache2.conf: Syntax error on line 13 of /etc/apache2/sites-enabled/wordpress"
I checked that I have the same version 7.3 and the sock file exists as you suggested. Any idea?
Thanks!
I have the same issue as you using apache2
The exact same issue with the exact same errors, I'm going to purge apache2, delete the wordpress install, and start again with nginx, I'd say there's some disparity between using apache2/nginx
I can confirm that the procedure shown in the video works when using nginx but noes not work with apache2, having tried with both apache 2 and nginx
Same problem for me. It only works for nginx
Hiii, thank you this was so helpful but can you please help me with this? It’s probably a dumb question but how would I restart my website if my pi has to reboot? I can’t seem to figure that out :/
You shouldn't need to restart the website/WordPress itself. In fact, it's not possible to do that.
On the other hand, if you need to restart the Nginx webs server like we do here 9:46
1st try got a 502 bad gateway error. Ill try to start over from scratch! I have no idea what im doing but im having fun and learning thanks to you!
Check this out for help fixing 502 errors ruclips.net/video/hYVriHb43wU/видео.html
the problem is that a new version of php-fpm was released (7.4) but the wordpress.conf file still uses 7.3
@@vladha3875 thank you man! That was it.
At 6:43 I'm getting a 502 error when running the server locally despite my conf file being identical to yours - any ideas why and how to fix?
ruclips.net/video/hYVriHb43wU/видео.html
@@TonyTeachesTech thanks!
im having issues with the images showing on my live website, is it because I need to change the permissions from www-data to my user?
I have run through this twice and tried troubleshooting it for a couple of hours. However, after I enter my creds, then enter submit, I get "error establishing a database connetion"
Anyone have any thoughts?
I don't comment often, but holy shit Tony this tutorial was amazing!! Thank you so much!! :)
I really appreciate that Matt!! You're quite welcome :)
Is it possible for nginx to serve open media vault and wordpress as well?
Is it possible to run wp with openmediavault? Or is there a way to change the ip for wp?
Hi Tony, Kindly guide me how to use this Rpi as a Wifi AP to browse WP content offline. can I add the WP index file as the captive screen for the AP?
I don't know how to do that sorry
Hey,
Just curious - is it possible to run more then one “WordPress service” or “wordpress projects” at the same time on a raspberry?
Yes! ruclips.net/video/P7W4iYkFaOU/видео.html
Hey Tony, Great video! I've been back through it a couple of time now and for some reason I get an error when trying to reload NGINX
2021/01/15 07:44:21 [emerg] 13285#13285: open() "/etc/nginx/sites-enabled/wordpress.conf" failed (2: No such file or directory) in /etc/nginx/nginx.conf:62
I would suggest trying to linking your conf file again. Please do the following:
rm /etc/nginx/sites-enabled/wordpress.conf
ln -s /etc/nginx/sites-available/wordpress.conf /etc/nginx/sites-enabled/
Then try to reload nginx
@@TonyTeachesTech That worked!!!! not sure what happened. Thank you for the help!
Happy to hear that. Good luck with everything!
Any tutorials on how to make WordPress SSL , I've been trying for months to try and get it to work. Most other tutorials on youtube don't seem to work.
You can get a free SSL with Let's Encrypt ruclips.net/video/PGDx3xxLGgA/видео.html
Thank you very much for your video, I have successfully built it according to the tutorial. How to publish the blog on the Raspberry Pi to the Internet in the next step? Can you publish a newbie tutorial?
I'll have a video on this topic in just a couple weeks
@@TonyTeachesTech Can't wait! I've seen about 10 tutorials how to set up WordPress on Raspberry and must admit - your tutorials are the best so far.
@@ArtokMobile May 17th, stay tuned :)
thanks !
Can you make a copy of your image and share this, so your viewers only have to adjust a few settings?
Got 502 bad gateway after going to IP. Any thoughts?
Probably a PHP version issue or something else. Check out this video for my recommendations ruclips.net/video/hYVriHb43wU/видео.html
I'm getting this error too also.
ver
y very good, thanks very much
You're welcome Matt Matt
Excellent video... Keep it up
Thanks. I will try my best
Hey Tony - great video :) Could you do one on RPI+ NGINX + JOOMLA ..... please.
Hi Martin, I'm not familiar with JOOMLA right now, but I'll add it to my list of future video topic ideas. Thanks!
did every step but now I'm stuck on bad gateway and the WordPress doesn't show up on the IP address of the pi, checked out your bad gateway video and it doesn't seem that I would have a php directory and it says no such file or directory. Need help thanks!
Please see if any suggestion in this video helps you ruclips.net/video/hYVriHb43wU/видео.html
@@TonyTeachesTech that’s the video I checked but sadly wasn’t the solution, I guess I’ll just start with a static webpage and add Wordpress later lol. Thanks though for making these videos helps a lot understand sudo commands etc.
Thanks!
No problem Jake
Hey tony 9:30 not able to symbolically link wordpress.conf to sites-enabled
Shows: ln:failed to create symbolic link ‘/etc/ngnix/sites-enabled/‘ : no such file or directory
great video
Thanks so much
I did everyhting until checking if site is live on my PC, by entering IP adress. I got 502 bad gateway
Another commenter (@greenviper4382) posted:
For people having the 502 bad gateway error. For me it fixed the issue by writing in the wordpress.conf: "server unix:/var/run/php/(your php version, for me: 7.4)-fpm.sock;" instead of the 7.3 that is in the code from his website. Hope this helps 😄
Same problem for me I struggle to find a solution
ruclips.net/video/hYVriHb43wU/видео.htmlsi=jwxYtzgwK66UeZP4
I resolved my problem using this video
pstream wp-php-handler {
server unix:/var/run/php/php8.2-fpm.sock;
}
server {
listen 80;
server_name _;
root /var/www/wordpress/;
index index.php;
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass wp-php-handler;
}
}
Im getting a problem while trying to install WordPress. Its unable to connect for some reason? It can install updates tho? It says failed route to host something.
At 4:00
502 bad gateway, I think my php fpm does not work. I ve been searching through multiple forums but can t figure it out.
See if any suggestions in here help ruclips.net/video/hYVriHb43wU/видео.html
Hi Tony, i tried to access my WP, but i am getting a 502 bad gateway error, and cannot see the config screen
The fixes in this video should get you running ruclips.net/video/hYVriHb43wU/видео.html
Nevermind i got it it was my php. the one on your link was 7.3 and the one i had was 7.4 Thanks for the help!
Hi Tony, I have a problems.
I has migration my Wordpress from Shared Hosting to VPS Vultr with All In One Migration Plugin
After, my Wordpress using PHP version 7.3, but my VPS using 7.4
How can i using php version 7.4 for my Wordpress?
P/S: I have to search on Google and they said:
- Go to /etc/nginx/sites-available/your.conf
- Change fastcgi_pass unix:/run/php/php5.X-fpm.sock; ==> fastcgi_pass unix:/run/php/php7.4-fpm.sock;
But my VPS not have /sites-available/your.conf (only have /conf.d/wordpress_http.conf and /conf.d/wordpress_https.conf)
And i don't see the line: fastcgi_pass unix:/run/php/php7.x-fpm.sock; in 2 files above
Pls help me, thank you very much
when I enter IP address of my tinkerboard I get error: 502 Bad Gateway
nginx/1.10.3
See if this video helps you solve the error ruclips.net/video/hYVriHb43wU/видео.html
@@TonyTeachesTech Thanks, that fixed the problem!
what are the differences and or better apache or nginx?
Check this out ruclips.net/video/BAMkvEvpol0/видео.html
hello i do this tuto but i have a page 502 Bad Gateway
nginx/1.18.0
can you help me please ?
See if this helps you ruclips.net/video/hYVriHb43wU/видео.html
have you tried to change the PHP file? the one on his link is 7.3 it should be 7.4
Hey Tony, I've been playing around for the past 4 days, but I encountered a issue while trying to assign ssl keys, I accidentally put the snippets of code into the wordpress file. Nginx now won't reload, start or anything. But refers to sites-enabled/etc..
In here I found by using the command ls -la
that the website named file I was trying to connect showed up as if it had registered as a symbolic link? (I'm a rookie :D )
How do I replace, remove or undo this mistake. As I was almost complete with the guide, I already assigned the certification in their respected files & location, & just needed to restart nginx, but since I changed wordpress.conf adding my new site name which is the one issuing with, and adding all though removed the ssl snippet of codes for the 3 certificates. It made some kinda havoc & I ran into this wall of commands, haha :)
ls -la within that directory and it shows this:
lrwxrwxrwx 1 root root 40 Dec 10 10:18 nginx.service -> /etc/nginx/sites-available/example,com (example,com should be wordpress.conf) how to go about changing this faulty symbolic link?
I remember I did ... /sites-available/example,com etc/sites-enabled,,, command
But if I try replacing that ... /sites-enabled/wordpress,conf etc/sites-available,,,
it say the files already exist.. Contrary if I try to remove the symbolic link for "example,com" , it says it doesn't exist
Starting to think it might be best to reinstall Nginx, but is that simple to do without affecting the installed wordpress & Mariadb? :) Sorry for my frequent messages, I will behave! Haha
Somehow managed to replace the ....etc/nginx/sites-enabled/ with the config file while trying to resolve the symlink because I forgot to put a / on the end, while doing rm rf ../patch.
At least now nginx -t works flawless, but still no site showing up
What if you want to host a https secure website? Do you just have nginx listen on port 443 instead of 80? Also, what if I buy a domain name from godaddy - how do I host that instead of referencing the IP address?
First, you'll need to make your Raspberry Pi accessible over the internet. This involves port forwarding on your home router. I do plan on posting a video about this in the next few months.
Then you can register your domain name and update the DNS A records to point to the IP address of your home network. Once you have that, get a free SSL certificate from Let's Encrypt. I have lot's of videos about that on this channel.
I know that sounds like a lot, but those are the high level steps. Stay tuned for more videos on this topic :)
@@TonyTeachesTech Part. 2 🔥
hi , i did everything as shown in the video @10:12 timestamp when i load the website
i get the following error
502 Bad Gateway
nginx/1.18.0
can you please help
You probably have the old php version in the config file you created for nginx. I had the same issue. Just changed the php version from 7.2 to 7.3 (the one that installs at the time of this comment) and it works fine.
Hi Tony, I followed your tutorial but if I want to open the page it says ERR_CONNECTION_REFUSED.
Can you please help me?
I linked the page to my domain, but I double checked all settings and everything is correct, port forwarding, the static IP is still okay, the IP address in the control panel from my domain provider is correct as well. I googled this error but I had no luck so far..
Are you able to access the page from your local network
@@TonyTeachesTech no I'm not, only via the "visit page" tab from wordpress, but if I type in the IP or domain name in the browser it doesnt work..
@@cedricmunschauer Please make sure the WP_HOME and WP_SITEURL match up with your URL wordpress.org/support/article/changing-the-site-url/#edit-wp-config-php
@@TonyTeachesTech thanks for your reply, I'm going to check that on monday, I let you know the result😊
Can anyone show or an example like this, but hosting more than one site? Like, what if I wanted to host two sites? Do I need domains to differentiate or how does it work?
can you show how to fix this error please..thank you
The uploaded file exceeds the upload_max_filesize directive in php.ini.
ruclips.net/video/PLKIPcY_eMs/видео.html
In your case, your version of PHP might be different and the directory might be nginx instead of apache2
@@TonyTeachesTech thank you Tony it works.. finally found the file at /etc/php/7.3/fpm/php.ini...
It's local host or live server?
In this video, this is a local server that's not available to the public
help please how do we update PHP I get this warning 'site is running an older version of PHP (7.3.27-1~deb10u1), which should be updated'
This video will help you ruclips.net/video/vJw6SX1fdUo/видео.html
How can I change the domain name? I have registered a free domain name at free nom but not sure how to make this my domain name instead of the rpi current IP address.
In free nom, find the DNS settings and add an A record with the value of your IP address ruclips.net/video/QcNBLSSn8Vg/видео.html
Can we use elementor pro on Raspberry PI 4???🤔
Yep
All was working great until my pi was assigned a new IP address on my new modem. WP keeps trying to go to the old IP address. I cleared the cache in my browser but no joy. Please point me in the right direction...
no thumbs down... boss
👍
why did you choose nginx over apache? I did research but want a different point of view (never mind I see a video you have about it thank you)
Personally I find the configuration in Nginx to be more intuitive than Apache, and as you probably saw in the other video Nginx is often times faster than Apache
I have a problem. I have rebooted and moved the Raspberry pi over to a cabled connection, and now nothing works. The index file is now accessed by a different ip address, no media is loaded correctly and I cannot access wp-admin either. If I click links on the index page it redirects top the old ip that was used when setting up the server and i get "this site can't be reached".
I would think it is an error with the database, since it redirects everything to the old ip address, but I have no idea how to fix it.
People of the future.
I managed to solve this issue by changing the ip address on the raspberry pi to fit the one in the database.
Not sure if that is the best solution, but it works for now.
Happy you were able to figure this out
Just install Docker and run Portainer stack that has the WP and database images and expose the port. Done.
Yep that's another option
i tried it, it doesn't work :(
to paste in nano use ctrl/control+shift+v the normal way to paste does not work probably to save the keybind for something else
If you use Apache instead of nginx jump to -> 3:44 🙂
👍
I setup wordpress and was working fine until i restarted pi and now the whole front page looks broken and won't let me sign in. Any solution to this?
Found out it was because of changed up
IP. What do i need to adjust to be able to set new static ip without having page crash?
Happy you were able to figure it out. You can set a static IP to solve this
@@TonyTeachesTech what about wordpress crashing when i activate elementor and elementor pro? I never found a solution to that. Even got in contact with their tech support and still nothing I've tried works :/
@@12Konst What happens when WP crashed?
@@TonyTeachesTech whenever i activate both elementor plugins, the wordpress shows me a white page and says i need to troubleshoot.
I've followed all steps minutely. However when I try to access to localhost it download a weird file, don't show the WordPress panel or Nginx welcome page, Idon't know why but this don't works to me :/ can anybody help me.
Even i have reviewed any error on WordPress.conf but it looks the same
Try to add your IP address as your server_name in your nginx config file
server_name YOUR_SERVER_IP_HERE;
@@TonyTeachesTech Ok you can fix it, I don't know why, but this only happens on the first PC I was accessing from, whatever, thank you very much Tony
@@jesusmeneses2771 Sorry, I don't offer that type of service. Did you try my suggestion? How about clearing browser cache on the 1st PC?
@@TonyTeachesTech No, i mean, this problem was solved with your solution Thank u so much bro
@@jesusmeneses2771 Oh sorry, I misunderstood you. I'm happy to hear that!
6:41 Where??????
Please check the description
apache won't restart!
and now how to acess from a domain
You'll need to open up the HTTP and/or HTTPS port on your router ruclips.net/video/AFeye1zLpFo/видео.html
And then create a DNS A record that points to your external IP address ruclips.net/video/QcNBLSSn8Vg/видео.html
Gone through it 3 times now and always get to the Wordpress 'database connection details' - then try login -
"Error establishing a database connection"
What am I doing wrong - about to pull my hair out... lol
Can you provide a timestamp?
@@TonyTeachesTech 10:46.
Add all details then next page says Error establishing database connection.
@@Martin5zn As long as your db name, username, password, and host are correct, then I don't see why this wouldn't work for you. In your terminal window, can you do this?
mysql -u username -ppassword wordpress
i hate this. after some time these linux tutorials is not going
and you are not that knowledgeable at all.
What is the issue that you're having?
Hii Tony Nice Video I have one question that I don't have Public IP is there is any way to connect the Pi from any other Location?
You will need to port forward port 80 (or 443 if using HTTPS) on your home router in order to the IP address of your Raspberry Pi in order to make is accessible from anywhere.
@@TonyTeachesTech Can you please make the Video How can We do this?
@@kkkant1547 Yes, I could do this for my specific router to demonstrate the general concept, although it would obviously be different steps if you don't have the same router as me.
thanks i did it with a bit update, change 7.3 to 7.4 in the wordpress.conf (2022/05/01), and i have to create 'another_name'@'localhost' with 'another_pw' in mariadb to get the db setup done
Ive got a small problem ive manage to make it all the way to the end but for some reason I cant login to my wordpress from a different device and I cant access the webpage by the url given. any clues as to how I can fix this?
How much memory RAM in the raspberry do you recommend
for the web site
This is one of those "it depends" answers. A lot of factors including size of the web pages and number of visitors to the site.