Hi
i bought a raspberry 4 to install apache web and simulate my website on the raspberry.
However my site was in php5 and during the installation of my new purchase, I am in php7.
Suddenly, all the hundreds of connection pages no longer work, I have to change my code and make a connection via PDO.
It is a Tytanic job and I will never see the end of it.
I still have the solution to force the installation on my raspberry with a PHP 5.4 version.
But I can't do it, I don't have the required skills.
I have reinstalled the system several times, but following the tutorials, APT INSTALL only installs the latest version of PHP, version 7.XX.
I downloaded well and tried to install an older PHP version with the MAKE, INSTALL ... functions and it does not work.
Have an idea to easily uninstall PHP 7 and install an older version like PHP 5.4 instead, in a beginner command line, like SUDO APT INSTALL PHP5.4 ...
thanks for your help
- DougieLawson
- Posts: 41035
- Joined: Sun Jun 16, 2013 11:19 pm
- Location: A small cave in deepest darkest Basingstoke, UK
- Contact: Website Twitter
Re: raspberry for Apache Web Server (with older PHP version)
Rewrite your PHP to work with PHP7 (which may mean some tiny tweaks and especially if you use MySQL). That will be more than a million times less painful than trying to install PHP5 on Buster.
Any language using left-hand whitespace for syntax is ridiculous
Any DMs sent on Twitter will be answered next month.
Fake doctors - are all on my foes list.
Any requirement to use a crystal ball or mind reading will result in me ignoring your question.
Any DMs sent on Twitter will be answered next month.
Fake doctors - are all on my foes list.
Any requirement to use a crystal ball or mind reading will result in me ignoring your question.
Re: raspberry for Apache Web Server (with older PHP version)
you are right ... but the work seems huge on hundreds of files ... writing in PDO is indigestible !
I tried to install an old version of RASBIAN or force the installation of PHP5 manually .. it did not work well
thank you for your advice
I tried to install an old version of RASBIAN or force the installation of PHP5 manually .. it did not work well
thank you for your advice
Re: raspberry for Apache Web Server (with older PHP version)
Try using mysqli instead. That is very similar to the old mysql functions.
Unreadable squiggle
Re: raspberry for Apache Web Server (with older PHP version)
great idea, thanks rpdom
it seem work fine but i have strange bug :
all my requests which include limits, they only output one line!
example :
i have just 1 line now
any idea ? thanks
it seem work fine but i have strange bug :
all my requests which include limits, they only output one line!
example :
Code: Select all
$affiche = "SELECT * FROM test ORDER BY date DESC LIMIT 0,10";

any idea ? thanks
-
- Posts: 17
- Joined: Sun Aug 16, 2020 9:09 am
Re: raspberry for Apache Web Server (with older PHP version)
How do you make a website? Can you help me?
- DougieLawson
- Posts: 41035
- Joined: Sun Jun 16, 2013 11:19 pm
- Location: A small cave in deepest darkest Basingstoke, UK
- Contact: Website Twitter
Re: raspberry for Apache Web Server (with older PHP version)
Follow the Raspberry Pi Foundation recipe for a Wordpress site at: https://projects.raspberrypi.org/en/pro ... -wordpress
That will get you a fully functional LAMP stack.
Any language using left-hand whitespace for syntax is ridiculous
Any DMs sent on Twitter will be answered next month.
Fake doctors - are all on my foes list.
Any requirement to use a crystal ball or mind reading will result in me ignoring your question.
Any DMs sent on Twitter will be answered next month.
Fake doctors - are all on my foes list.
Any requirement to use a crystal ball or mind reading will result in me ignoring your question.
Re: raspberry for Apache Web Server (with older PHP version)
that's really easy (if your website works with php7 same the last wordpress version)
try this :
https://howtoraspberrypi.com/how-to-ins ... y-pi-lamp/
try this :
https://howtoraspberrypi.com/how-to-ins ... y-pi-lamp/
-
- Posts: 17
- Joined: Sun Aug 16, 2020 9:09 am
Re: raspberry for Apache Web Server (with older PHP version)
But can I design my site the way I want with wordpress? And if so, how?DougieLawson wrote: ↑Mon Sep 14, 2020 6:12 pmFollow the Raspberry Pi Foundation recipe for a Wordpress site at: https://projects.raspberrypi.org/en/pro ... -wordpress
That will get you a fully functional LAMP stack.
Re: raspberry for Apache Web Server (with older PHP version)
What kind of web site do you have in mind?RaspiFanBoy wrote: ↑Mon Sep 14, 2020 7:14 pmBut can I design my site the way I want with wordpress? And if so, how?
Personally would never dream of using Wordpress to do what I want in a web site.
If you just want to serve up some static pages then by all means install the Apache web server or Nginx. Then start writing the HTML, CSS and Javascript you want on the pages. The internet is full of advice as to how to do this. For example https://www.w3schools.com/ and thousands of tutorials and blogs.
If you want some interactivity then it's time to look into using node.js for your web server and something like the React library for the browser side interface.
There are so many options. What do you actually want to do?
Memory in C++ is a leaky abstraction .
-
- Posts: 17
- Joined: Sun Aug 16, 2020 9:09 am
Re: raspberry for Apache Web Server (with older PHP version)
I think a website like that about ireland in the projects. A simple. Or another. But my question is: Where can i code the website if i use this LAMP projectHeater wrote: ↑Mon Sep 14, 2020 7:34 pmWhat kind of web site do you have in mind?RaspiFanBoy wrote: ↑Mon Sep 14, 2020 7:14 pmBut can I design my site the way I want with wordpress? And if so, how?
Personally would never dream of using Wordpress to do what I want in a web site.
If you just want to serve up some static pages then by all means install the Apache web server or Nginx. Then start writing the HTML, CSS and Javascript you want on the pages. The internet is full of advice as to how to do this. For example https://www.w3schools.com/ and thousands of tutorials and blogs.
If you want some interactivity then it's time to look into using node.js for your web server and something like the React library for the browser side interface.
There are so many options. What do you actually want to do?
Re: raspberry for Apache Web Server (with older PHP version)
That makes no sense what so ever.RaspiFanBoy wrote: ↑Mon Sep 14, 2020 8:12 pmI think a website like that about ireland in the projects. A simple. Or another.
If you want to create a web server setup with Linux, Apache, MySql, PHP, (LAMP) then advice in the form of tutorials, blogs, documentation is all over the net. For example: https://www.mgcwebsites.co.uk/raspberry ... webserver/RaspiFanBoy wrote: ↑Mon Sep 14, 2020 8:12 pmBut my question is: Where can i code the website if i use this LAMP project
Memory in C++ is a leaky abstraction .
-
- Posts: 17
- Joined: Sun Aug 16, 2020 9:09 am
Re: raspberry for Apache Web Server (with older PHP version)
But where i can code my website or make my website. There is no tutorial on where to code the website if i make a LAMP website. There are only themes or plugins. Or should i upload a website or something? Plss explainHeater wrote: ↑Mon Sep 14, 2020 8:50 pmThat makes no sense what so ever.RaspiFanBoy wrote: ↑Mon Sep 14, 2020 8:12 pmI think a website like that about ireland in the projects. A simple. Or another.If you want to create a web server setup with Linux, Apache, MySql, PHP, (LAMP) then advice in the form of tutorials, blogs, documentation is all over the net. For example: https://www.mgcwebsites.co.uk/raspberry ... webserver/RaspiFanBoy wrote: ↑Mon Sep 14, 2020 8:12 pmBut my question is: Where can i code the website if i use this LAMP project
Re: raspberry for Apache Web Server (with older PHP version)
so when I do a simple request that includes the LIMIT function, this one is not taken into account, I only have one line.
I think the error could come from my loop with the WHILE function ?
or else I don't close the connection, I never use mysqli_chose ()
I think the error could come from my loop with the WHILE function ?
or else I don't close the connection, I never use mysqli_chose ()
Re: raspberry for Apache Web Server (with older PHP version)
If you want to create a web server using Apache, PHP and MySql on a Raspberry Pi then follow the instructions to get everything installed here: https://www.raspberrypi.org/documentati ... /apache.md. But skip the last part about WordPress.RaspiFanBoy wrote: ↑Tue Sep 15, 2020 5:03 amBut where i can code my website or make my website. There is no tutorial on where to code the website if i make a LAMP website. There are only themes or plugins. Or should i upload a website or something? Plss explain
At that point you will have a web server running and you will have seen your first PHP code creating content you can view with your web browser.
Now you have a long road ahead:
1) You are going to need to know how to create web pages with HTML. See google for "html tutorial". This is a good start though: https://www.w3schools.com/html/
2) If you want your pages to look nice you are going to need to learn about Cascading Style Sheeets, CSS. See google again. w3schools also have good material on that: https://www.w3schools.com/css/
3) Most likely you will want to use Javascript in your web pages. w3schools again: https://www.w3schools.com/js/
4) And of course there is learning how to program in PHP: https://www.w3schools.com/php/DEFAULT.asp
5) Then there is that MySql data base thing: https://www.mysqltutorial.org/
All of the above is just the basics. But will get you started and point you in directions you might want to go in.
Of course as we are on the internet and this is all about web technology there are thousands of tutorials, blogs, youtube videos, etc about all these things just a google search away. Or there are even hundreds of real, good old fashioned books to be had.
Memory in C++ is a leaky abstraction .