• Resolved cchildspi

    (@cchildspi)


    Hello Everyone,

    I just bought a Raspberry PI 3 and in the process of setting it up as a Web Server using WordPress The Raspberry forum folks sent me over here to you all for assistance. I followed the installation tutorial to the letter for setting up APACHE2. Then I get to the WordPress configuration and ran across an issue. The issue seems to be with PHP. It says that I should be getting a WordPress Welcome page, but all I get is:

    “Front to the WordPress application. This file doesn’t do anything, but loads we-blog-header.php which does and tells WordPress to load the theme”

    I even tried to go to the site/wordpress/wp-admin and php code showed up on that page as well. So it seems like php is the cultprit.

    Any ideas on how to continue or fix this?

Viewing 15 replies - 1 through 15 (of 20 total)
  • Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    You do not have PHP properly installed. It’s showing you the content of index.php, not executing it. How you do that depends on your operating system. This is not a WP problem. Sorry, but you need to bounce back to the Raspberry forum for assistance configuring your web server.

    Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    Short version:

    If you don’t mind or have a spare microSD card, try this site.

    https://inabox.blog/

    It offers a very straight forward way to get WordPress working on a Raspberry Pi 3. It’s really good IMHO.

    Longer version:

    You’ll need to install PHP manually. This will get that started.

    
    sudo apt-get install php5
    

    That should do it but you may need to install the php5-mysql package the same way as well as mysql-server and mysql-client first if you don’t have those installed already.

    Thread Starter cchildspi

    (@cchildspi)

    Firstly, I did try to get assistance over at the Raspberry forum. They suggested I come here for help. No you say I should go there. I’m at a lost on this. I have PHP installed. It is version 7. Apparently, version 5 is outdated. I have MYSQL installed as well. As for the configuration of these various programs, I’m not 100 percent sure, but they are all installed. As previously mentioned, I followed the installations to the letter. I just don’t know where to turn at this point.

    Thread Starter cchildspi

    (@cchildspi)

    I will give a shot. At this point, it cant hurt

    Thread Starter cchildspi

    (@cchildspi)

    well, I got the blog in a box installed, however on initial boot when I try to login it tells me login incorrect. I have done it 3 times.

    Thread Starter cchildspi

    (@cchildspi)

    Update….I was able to login into blog in a box. I am at the command terminal. I don’t see a way to open a browser or anything

    Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    The blog in a box doesn’t have a desktop. It’s miniature Linux server and you access it via the IP address on your network from your desktop with your browser.

    Do you know the IP assigned to it?

    Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    Side note: I’ve lost count of all the Raspberry Pi 3s I have. It’s a great platform for a Linux server. ??

    Thread Starter cchildspi

    (@cchildspi)

    Then how do I get to a browser if it doesn’t have a GUI/destktop/browser. When I type in sudo hostname -I, it comes back with an ip of 127.0.1.1. Although for some reason, I though my ip was 192.168.1.39. That’s what it shows on my router configuration. So to be honest, your guess is as good as mine. As I am typing this message, I just so happened to type in the 192.168.1.39 in the browser on my laptop which is separate from the Rasp PI, and something came up. Now I am really confused because I thought I was supposed to be working on my Rasp PI not my laptop. I apologize in advance for the silly questions as this is brand new to me.

    Hey @cchildspi,

    Happy to see you using a raspberry pi for this. Big fan of all things Pi ??

    So the problem you originally described was that the site wasn’t being served correctly. Now that you have bloginabox installed it is being served correctly so I think the problem you opened with is somewhat solved.

    Sounds like it’s not working how you expected though, did you expect to only have access to the WP site when using the browser on the rPi? Webserver software is usually setup to listen for incoming connections from other machines – that’s how bloginabox is setup anyway. You can access the site from any other computer on the same network by typing the IP address into the browser.

    I haven’t used bloginabox myself before however it looks like it’s built from the base raspbian build so when you reach the command terminal on the pi try type the command startx then press enter and see if the GUI runs.

    Thread Starter cchildspi

    (@cchildspi)

    Thanks for the encouraging response William. You are correct regarding my original issue which was the .php content was not displaying correctly. It was displaying the actual .php code. However installing blog in a box on a different SD card solved that problem. When I downloaded blog in a box then booted on the Rasp PI, I had no idea how to get to it since the download only had terminal command. It turns out as you mentioned that I just had to type in my ip address into a browser on any other computer. I spent several hours on the Rasp PI trying to find a browser to type the IP address in. So I just grabbed my laptop, typed in the IP address and it loaded bright as day. I didn’t know it worked that way. I also didn’t know that if you try to access that same IP address on a computer not on the network that it wont work. That’s essentially what I wanted to do, but it sounds like there is more involved to be able to access the pi server outside the local network. I also now know that blog in the box is a (I forgot the wording) but a basic Lite setup of Rasbian so, no, it does not have a GUI (no Desktop nor Browser) installed at all. Just for the record I tried startx during my trial and error experience, and it didn’t work.

    On the bright note out of all this frustration, I am learning. Fun and frustrating at the same time.

    Fun and frustration is sometimes the name of the game sadly haha

    Now that I know you are wanting to connect to the site on the raspberry pi from outside of your local network I can probably help with that. It’s quite a lot of steps involved and there are a number of steps that could be confusing so I’ll try my best to explain in detail.

    In short it’s really just 2 steps:

    • Forward port 80 from your router to your raspberry pi (at this point the raspberry pi site is accessible from outside the network by connection to your networks external IP)
    • Setup dynamic hostname to connect to it so you can type in something like myrpi.domain.com to access it instead of needing to know the latests IP.

    To access the site running on the raspberry pi from outside your network you need to configure something called ‘port forwarding’ in your router. Browsers connect by default to an address on port 80 which will be the port that the raspberry pi webserver is listening on.

    You need to go into the configuration on your router and forward incoming connections on port 80 to the raspberry pi. Forward both TCP and UDP if it has the option to pick which one. All routers have different configuration methods and interfaces to access them so I can’t give exact steps to do this on your router but usually you can google your router model number plus ‘port forward’ to get a guide online.

    Once you have the port forwarded you will then be able to access the site on the pi from outside the network by typing in your EXTERNAL IP address (not the private address that your router assigns). From on the network with the pi (you can do this on your laptop since it’s connected to the same network) you can ask google what your IP address is and it will tell your your connections external IP.

    At that point you will be able to connect to the site on the pi from a device not on your network by typing the EXTERNAL IP into the browser. You could test this using your phone and disconnecting from wifi so that it uses the mobile data connection instead and typing the EXTERNAL IP into the browser.

    Now that it should be accessible from outside your local network you need to think about how often your EXTERNAL IP is likely to change – most internet connections have dynamic IP addresses and can change often. Everytime your IP address changes you will need to let people know the updated IP address.

    That’s not a very user friendly way to do it so instead you can look into setting up a hostname that points to your dynamic IP address. I have the free account from https://www.noip.com/ before to do this in the past but there are other services that you can do it with (noip has a client that can run on raspberry pi though that makes keeping the IP address updated easier).

    If you chose to use noip for this then the final step will be to install their client on the raspberry pi. This article explains that process: https://www.averagemanvsraspberrypi.com/2013/09/using-raspberry-pi-as-noip-client.html

    So I tried to explain things as best I could but it can be a complicated process to get this setup and working so feel free to ask me to clarify anything that is unclear ??

    Thread Starter cchildspi

    (@cchildspi)

    William, I have copied your advice for when I try to continue. Just for kicks and giggles, I completely started over on my original sd card. I uninstalled everything (Apache2, MySQL, PHP, WordPress) and reinstalled to try again. I’m still getting the actual .php code instead of the content. It bothers me that I cant find the culprit. For those of you that don’t know, the tutorial has you install Apache 2, PHP and PHP module for Apache, and then onto WordPress setup. I installed Apache 2 and tested. No Problem. Step 2 Install PHP and PHP module for Apache. The installation portion went just like it was supposed to. The tutorial then has you test the PHP. It has you enter in the index.php file:

    <?php echo “hello world”; ?>

    At this point the output should be:

    “hello world”

    But the output I get is:

    <?php echo “hello world”; ?>

    That should have been my first clue that I was going to have problems when I got to the WordPress .php items at my first attempt at this project. But being new, I had no idea. I just continued the tutorial. Now that I have tried on numerous occasions I am stopping here just to see if a solution can be found. If anyone knows where I went wrong, please chime in. This is the tutorial I was following.

    https://www.raspberrypi.org/documentation/remote-access/web-server/apache.md

    Thread Starter cchildspi

    (@cchildspi)

    Anyone know what this means:

    The first item for mods available does indeed show php7.0.conf and php7.0.load
    The second item for mods available:
    When I typed in ls /etc/apache2/mods-enabled/ | grep php, it just moved to the next command line. So I proceeded with sudo a2enmod php7.0 and it gave me the following results:

    Considering dependency mpm_prefork for php7.0:
    Considering conflict mpm_event for mpm_prefork:
    ERROR: Module mpm_event is enable – cannot proceed due to conflicts. It need to be disable first!
    Considering conflict mpm_worker for mpm_prefork:
    ERROR: Could not enable dependency mpm_prefork for php7.0, aborting

    Try just ‘php’ maybe?

    sudo a2enmod php

Viewing 15 replies - 1 through 15 (of 20 total)
  • The topic ‘WordPress/PHP Installation Problem’ is closed to new replies.