How to get the Wordpress package running on PHP 7.0?

Discussion room for Wordpress, a weblog based social networking community.
Forum rules
1) This is a user forum for Synology users to share experience/help out each other: if you need direct assistance from the Synology technical support team, please use the following form:

https://account.synology.com/support/su ... p?lang=enu



2) To avoid putting users' DiskStation at risk, please don't paste links to any patches provided by our Support team as we will systematically remove them. Our Support team will provide the correct patch for your DiskStation model.
checkmate
I'm New!
I'm New!
Posts: 2
Joined: Mon Mar 13, 2017 8:05 am

How to get the Wordpress package running on PHP 7.0?

Unread post by checkmate » Mon Mar 13, 2017 8:18 am

Hi all,

I have just installed PHP 7.0 on my Synology. I am running the Synology Wordpress package for one of my websites, and I am running my own Wordpress instance in a virtual website folder for another website.

For this last one, I have been succesful to change the website to PHP 7.0 (enable the correct extensions in the PHP 7.0 settings, change the virtual website settings to PHP 7.0, and everything works as expected).

For the official Wordpress package, I can't seem to get this working though. General Webstation settings have been set to PHP 7.0, but Wordpress keeps running on PHP 5.6. When I stop Wordpress, and stop PHP 5.6 too, I can't start Wordpress again. It complains that it needs PHP 5.6. Is there anyway I can get the Wordpress package to run on PHP 7.0?

Thanks!

puggywug
I'm New!
I'm New!
Posts: 5
Joined: Sat Mar 18, 2017 9:24 pm

Re: How to get the Wordpress package running on PHP 7.0?

Unread post by puggywug » Sat Mar 18, 2017 9:37 pm

I have the same question, but in addition to this I want to serve my wp installation with nginx rather than apache 2.2.

wutikorn
I'm New!
I'm New!
Posts: 6
Joined: Thu Mar 23, 2017 3:25 pm

Re: How to get the Wordpress package running on PHP 7.0?

Unread post by wutikorn » Thu Mar 23, 2017 3:45 pm

https://forum.synology.com/enu/viewtopi ... 0&t=129278
Set PHP to enable mysqli, use virtual server, choose Nginx/Apache2.2/Apache2.4, PHP 7.0, then that's it.

checkmate
I'm New!
I'm New!
Posts: 2
Joined: Mon Mar 13, 2017 8:05 am

Re: How to get the Wordpress package running on PHP 7.0?

Unread post by checkmate » Thu Mar 23, 2017 9:23 pm

wutikorn wrote:https://forum.synology.com/enu/viewtopi ... 0&t=129278
Set PHP to enable mysqli, use virtual server, choose Nginx/Apache2.2/Apache2.4, PHP 7.0, then that's it.
Thanks, but that works for virtual servers with your own Wordpress installation only. I am looking for a way to run the Wordpress package from the Synology repo on PHP 7.0.

wutikorn
I'm New!
I'm New!
Posts: 6
Joined: Thu Mar 23, 2017 3:25 pm

Re: How to get the Wordpress package running on PHP 7.0?

Unread post by wutikorn » Sat Mar 25, 2017 5:17 am

What about pointing that virtual server to Synology Wordpress folder? It will still be virtual server, but at least you get to choose version of back-end server.

puggywug
I'm New!
I'm New!
Posts: 5
Joined: Sat Mar 18, 2017 9:24 pm

Re: How to get the Wordpress package running on PHP 7.0?

Unread post by puggywug » Mon Apr 10, 2017 2:19 am

I got it working...

Go to Package Manager
Install Web Station, PHP 7.0, MariaDB, phpMyAdmin

Go to Web Station
General Settings
HTTP back-end server: Nginx
PHP: PHP 7.0
PHP Settings:
PHP version: PHP 7.0
Enable PHP cache: Yes
Enable all PHP extensions (figure out which ones are really needed sometime)
Virtual Host:
Create:
Port based
Port: HTTP [your vhost's http port], HTTPS [your vhost's https port]
Document root: web/your_folder
HTTPS Settings: HSTS, HTTP/2
HTTP back-end server: Nginx
PHP: PHP 7.0

I couldn't get name-based virtual hosts working; still trying to figure that out.

Download latest wordpress install files form https://wordpress.org/download/
Unzip wordpress install files to the virtual host's folder, eg "your_folder" above.

Browse to the site at https://[ds1515's hostname]:[vhost's https port]

Run wordpress install. I had a few problems at this point, not sure why, mostly database access issues, and also I needed to manually create the wp-config.php file because the webserver didn't have sufficient permission to write it itself. I had to use phpMyAdmin to create a new MySQL db for the wordpress install. I had tried to just use the existing MySQL db that the Synology Wordpress package had created when I installed WP from that, but it didn't feel reliable to do that, so I just created a new database using phpMyAdmin to ensure that it was a new, clean db for the new WP install.

Now that it's up and running, I'm trying to figure out how to do the same custom install for phpMyAdmin, so I can stop using the Synology package version, which depends on PHP 5.6, and get a manually installed phpMyAdmin running on PHP 7.0, so I can remove PHP5.6 entirely.

shackbill
I'm New!
I'm New!
Posts: 4
Joined: Sat Apr 29, 2017 6:56 pm

Re: How to get the Wordpress package running on PHP 7.0?

Unread post by shackbill » Sat Apr 29, 2017 7:02 pm

puggywug wrote:I got it working...


Run wordpress install. I had a few problems at this point, not sure why, mostly database access issues, and also I needed to manually create the wp-config.php file because the webserver didn't have sufficient permission to write it itself. I had to use phpMyAdmin to create a new MySQL db for the wordpress install. I had tried to just use the existing MySQL db that the Synology Wordpress package had created when I installed WP from that, but it didn't feel reliable to do that, so I just created a new database using phpMyAdmin to ensure that it was a new, clean db for the new WP install.
I'm trying to follow your suggestions in this post but not really understanding about the wordpress install. I went to the virtual folder to run the wordpress install from there but after i enter the DBName/Username/Password/localhost/prefix, i get a 405 not allowed. I created a database and user account for the DB using pHpMyadmin. After ive extracted the latest wordpress package (4.7.4) into the virtual folder, am i supposed to run the Synollogy Wordpress package?? Wont that create another install? Did you ever get this all working properly? thanks for your efforts on this. Wish there was a comprehensive doc.

UPDATE: Ok..i got it working. When i created the DB, i also created a different DB User Account (Same global privileges) instead of ROOT and tried to use that but it failed. Once i changed it to ROOT, the install went as expected. Also, i seem to have it working using Named Virtual Host as well. Once i get everything running as expected and tested, i will try to write a document but i'm not so sure i completely understand how the virtual host is working..

UPDATE 2 I cant seem to add any plugins or Themes. Did you have to CHOWN anything. I tried changing ownership in File Station to http but that didnt work.

UPDATE 3
Changed http GROUP to R/W. Plugins and Themes work. Now, how to get php_mail to send.

Gazou
I'm New!
I'm New!
Posts: 1
Joined: Fri Dec 15, 2017 5:33 pm

Re: How to get the Wordpress package running on PHP 7.0?

Unread post by Gazou » Fri Dec 15, 2017 5:48 pm

got it to work on php 7.0.24 !!!

Install the default package from Synology.
Then go to your Wordpress dir and find the .htaccess file then open it with a text editor.

You have to rem out a couple of lines.

Here is what I have in my .htaccess file.

# Synology PHP
AddHandler default-handler .htm .html .shtml
# AddHandler php-fastcgi .php
AddType text/html .php
# Action php-fastcgi /php56-fpm-handler.fcgi
# Synology PHP

Your Wordpress should work now with PHP 7

borup
I'm New!
I'm New!
Posts: 1
Joined: Sun Apr 08, 2018 1:01 pm

Re: How to get the Wordpress package running on PHP 7.0?

Unread post by borup » Sun Apr 08, 2018 1:04 pm

# Action php-fastcgi /php70-fpm-handler.fcgi

Steve1200
Rookie
Rookie
Posts: 31
Joined: Sat Apr 30, 2016 3:11 pm

Re: How to get the Wordpress package running on PHP 7.0?

Unread post by Steve1200 » Fri Jun 01, 2018 3:01 am

I do not run the Synology version of WordPress anymore because security updates lag behind. After many attempts to get WordPress running on Apache 2.4 and php7, I installed WordPress from WordPress.org. Then I created some instructions at this link: Installing WordPress from WordPress.org

Post Reply

Return to “Wordpress”