Install WordPress from WordPress.org on Synology

Steve
Posts: 120
Joined: Sun Oct 01, 2017 3:08 pm

Re: Install WordPress from WordPress.org on Synology

Post by Steve »

That's GREAT! Personally I don't use underscores but if everything works as you say, you should be able to enter
http://domain.name/wordpress_org and WordPress will load.

Additionally you can rename the Synology index.html and add an index.php file to load WordPress. The file should be placed in the web folder with the content below.

Code: Select all

<?php
/**
 * Tells WordPress to load the WordPress theme and output it.
 *
 * @var bool
 */
define('WP_USE_THEMES', true);

/** Loads the WordPress Environment and Template */
require( dirname( __FILE__ ) . '/wordpress_org/wp-blog-header.php' );

wobble
Posts: 13
Joined: Mon May 25, 2020 4:46 pm

Re: Install WordPress from WordPress.org on Synology

Post by wobble »

Not exactly great unfortunately.

As I couldn't reach /wordpress_org using my domain name, I used the lan IP address to go through the WordPress install process.

Then in settings I gave the domain name as suggested elsewhere http://www.mydomainname/ for both settings.

Then I setup 2 virtual hosts for mydomainname and for www.mydomainname which point to the /wordpress_org directory, and renamed the index.php file in the /web directory.

Using mydomainname in browser results in timeout. Using internal lan address no longer works with the /admin appendage; without it I reach some improperly formatted text from WordPress.

So now I have deleted the virtual hosts yet again, and reinstated the index.php which points to wordpress_org, and updated the database so siteurl and home both point to http://www.domainnameurl/wordpress_org.

Now it is just timing out as usual when I try to access from browser with mydomainname..

Is there a trace / log utility I can use to find out what is going on? I've set the log on for PHP 7.3 yesterday but no file has been written yet.
Last edited by wobble on Wed May 27, 2020 5:38 pm, edited 1 time in total.

Steve
Posts: 120
Joined: Sun Oct 01, 2017 3:08 pm

Re: Install WordPress from WordPress.org on Synology

Post by Steve »

If you can access the Synology screen using your domain name, you should be able to set up WordPress using the domain name as well. When I wrote the original instructions WordPress was on version 3 but now is on version 5.4.1 so they may have changed some things.

Since you used a LAN during setup did you check wp_users table? I believe admins have the URL there as well. Changing that might help you log in again.

If you can use your domain name and get to the Synology page you should be able to get to a sub-folder just as easily unless permissions are not set correctly. You can use file station to check the properties. The minimum needed for group http is Allow with Read & Write enabled.

wobble
Posts: 13
Joined: Mon May 25, 2020 4:46 pm

Re: Install WordPress from WordPress.org on Synology

Post by wobble »

This is so weird! Maybe a problem that has nothing to do with WordPress.

I was wondering about permissions... http had read only permissions, so I changed this for the directory with wordpress in it. (What about the rest of the files in /web ?). I also changed the URL in the wp-users table.

It makes no difference though. It still times out when trying to access wordpress with the domain name.

On the General screen of file properties for most, but not all folders (not files) there is a field 'Access Link' with a value for example "https://www.domainname.com:5001/index.cgi?launchApp=SYNO.SDS.App.FileStation3.Instance&launchParam=openfile%3D%252Fweb%252Fwordpress_org%252F". What is this about? and why is my domain name there? - as I said it applies to most directories on my NAS, but not top level ones such as /web.

It is a shame there is no trace - log process for debugging this!
Last edited by wobble on Thu May 28, 2020 6:29 am, edited 1 time in total.

Steve
Posts: 120
Joined: Sun Oct 01, 2017 3:08 pm

Re: Install WordPress from WordPress.org on Synology

Post by Steve »

I've talked to some that made the mistake of changing web folder permissions. This can mess up WAN access up as well as phpMyAdmin. In the beginning I messed up web station and finally had to reinstall it. That is one of the reasons I started this website. For many issues I could not find help or examples that actually worked or explain in detail what might be wrong.

Permissions are important not only for folders but for files as well. If a program cannot access the a setup or write to the config file, it will not load. The best way to install a web program on a Synology NAS is copy the zip file to the web or a sub-folder inside the web folder, then use file station to extract the contents. File Station automatically assigns files and folders inherited permissions so they have WAN access. Note: if installing in a sub-folder, create the sub-folder with File Station. When folders are created with another OS, the group needed for internet access may not be assigned the correct permissions.

The access link is something Synology creates to access the folder directly through DSM using your domain name. If you look at parent folders, Synology creates, and individual files, there are no access links. The 5001 after the domain name is the port number to access DSM on your NAS. If you enter http://domain.name:5001into your browser, you are directed to port 5001 on the assigned device connected to your network. This is why port forwarding is so important on your router.

Steve
Posts: 120
Joined: Sun Oct 01, 2017 3:08 pm

Re: Install WordPress from WordPress.org on Synology

Post by Steve »

It may be easier to check website functionality one step at a time. This involves creating three files. The first is placed in the web folder. The next two are placed in the WordPress folder. If the first file loads successfully using your domain name, Web Station is working. If the second page loads the WordPress folder is readable from the internet. The third page confirms php is enabled and displays the modules that are loaded and the configuration settings.

To run this test rename the existing index.html file in the web folder. Create a new index.html file with the following content:
(Edit the form action and enter your domain name and the WordPress folder name, if different)

Code: Select all

<!DOCTYPE html>
<head>
	<title>Page Tests</title>
	<meta name="description" content="Load HTML Page">
	<meta name="author" content="SKDavis.net">
</head>
<body>
	<div id="outer">
		<div id="container">
			<p> <form action="http://domain.name/wordpress/success.html">
	        <button class="button" type="submit">Click to load HTML Page</button></p>
		</div>
	</div>
</body>
</html>
<style>
	html {
		height: 100%;
		overflow: hidden;
	}
	body {
		background-image: linear-gradient(#1e4ed4, #a7bbf2);
	}
	div#outer {
		height: 100%;
		width: 100%;
		padding: 10% 0;
	}
	div#container {
		text-align: center;
		padding: 10% 0;
	}
	.button {
		border-radius: 10px;
		font-size: 2em;
		font-weight: bold;
		font-family: Serif, Verdana;
		color: blue;
	}
	.button:hover {
		background-color: #1e4ed4;
		color: white;
		cursor: pointer;
	}
</style>
In the WordPress folder, create two files. The first is an html file and ensures you can access the folder from the internet. The second is a php file and will display the php configuration and settings.

Name the second file success.html and place in the WordPress folder. This file confirms the WordPress folder is readable from the internet.
(Edit the form action and enter your domain name and the WordPress folder name, if different)

Code: Select all

<!DOCTYPE html>
<head>
	<title>Test Page</title>
	<meta name="description" content="Load PHP Page">
	<meta name="author" content="SKDavis.net">
</head>
<body>
	<div id="outer">
		<div id="container">
			<p id="paragraph"><b>SUCCESS!<br/>
			Page loaded!</b><br>
			<p> <form action="http://domain.name/wordpress/phpinfo.php">
	        <button class="button" type="submit">Click for PHP Info</button></p><br/>
			<br>
		</div>
	</div>
</body>
</html>
<style>
	html {
		height: 100%;
		overflow: hidden;
	}
	body {
		background-image: linear-gradient(#1e4ed4, #a7bbf2);
	}
	div#outer {
		height: 100%;
		width: 100%;
		padding: 8% 0;
	}
	div#container {
		text-align: center;
		padding: 10% 0;
	}
	#paragraph {
		text-align: center;
		color: #e5ed51;
		font-size: 4em;
		font-weight: bold;
		font-family: Serif, Verdana;
	}
	.button {
		border-radius: 10px;
		font-size: 2em;
		font-weight: bold;
		font-family: Serif, Verdana;
		color: blue;
	}
	.button:hover {
		background-color: #1e4ed4;
		color: white;
		cursor: pointer;
	}
</style>
The last file is phpinfo.php. Place this file in the WordPress folder. If this page does not load either php is not installed or is not configured correctly.

Code: Select all

<?php
	phpinfo();
?>

wobble
Posts: 13
Joined: Mon May 25, 2020 4:46 pm

Re: Install WordPress from WordPress.org on Synology

Post by wobble »

I seem to making some progress here! The Success page is loaded. So I am no longer stuck in the /web folder now.

On the other hand, when I push the 'php-info' button there's a white screen which evenutually times out.

For a while I thought there might be a problem with the port forwarding on my router, but I think I dug up some wrong information on the internet about this.

It looks like I need to learn a bit more about php!

Steve
Posts: 120
Joined: Sun Oct 01, 2017 3:08 pm

Re: Install WordPress from WordPress.org on Synology

Post by Steve »

You getting there! The white screen means either php is not loaded or not configured. First open package manager and confirm php is installed. If you are using phpMyAdmin php5.6 is required but should not be used for a website as it is no longer supported. (Synology finally updated phpMyAdmin) Use php 7.0 or above. Open web station, go to General Settings and make sure a HTTP Back-end server is selected. Use Apache if you are using WordPress. Then select the version of php you want to use. Then select Apply.

Image

Next select PHP Settings. If you have more than one version of php make sure you have a default profile for each version. Select the version, then select the edit button.

Image

Enter a profile name and description, then select the version of php to configure. Check the name box to enable all modules. Then select OK. Once you have everything working, you can go back and edit the profile to disable modules that are not required.

Image

You can create multiple profiles which is useful if you are using virtual host with programs that require specific modules and settings.
Last edited by Steve on Sat Jun 27, 2020 8:55 am, edited 1 time in total.

wobble
Posts: 13
Joined: Mon May 25, 2020 4:46 pm

Re: Install WordPress from WordPress.org on Synology

Post by wobble »

Sorry, I did not get the folder name right .. now that is corrected I have a page of information all about PHP 7.3.11!

I have set http permissions to read+write for the wordpress_org directory. The other directories are read only - 'logs', 'phpMyAdmin', 'web-images'...

I've not changed my web station set-up - Apache 2.4, PHP 7.3. All PHP extensions are selected except ssh2.
Last edited by wobble on Sun May 31, 2020 7:06 am, edited 2 times in total.

wobble
Posts: 13
Joined: Mon May 25, 2020 4:46 pm

Re: Install WordPress from WordPress.org on Synology

Post by wobble »

I have set http permissions to read+write for the wordpress_org directory. How about the other /web folders? - 'logs', 'phpMyAdmin', 'web-images'...
Last edited by wobble on Sun May 31, 2020 5:08 am, edited 1 time in total.