Installing OpenPhoto on Shared Hosting

How To Install OpenPhoto on Shared Hosting

After burning too much time just getting to a functioning /setup page, here my record of how it was solved.

Followed instructions from https://vinayaugustine.com/wiki/webfaction/openphoto (saved below as a gist in case the original resource becomes unavailable)

Installing Openphoto on Webfaction

These are instructions for installing (openphoto)[https://openphoto.me/] on https://webfaction.com.

I used this answer on the WF community for both installations.

Before using openphoto, you have to install the OAuth and ImageMagick PECL packages.

The following script will download openphoto and install the dependencies:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
# download openphoto
git clone https://github.com/photo/frontend.git openphoto
cd openphoto
# create the userdata folder
mkdir -p src/userdata
# make the assets folder writable by the apache user
setfacl -R -m u:apache:rwx src/html/assets
# create a temporary directory to install the PECL extensions
mkdir ~/pecl_install
cd ~/pecl_install
# create the actual pecl installation folder and the companion php.ini
makedir -p ~/openphoto/pecl/
echo "extension_dir = $HOME/openphoto/pecl/" >> ~/openphoto/src/html/php.ini
# install OAuth
wget http://pecl.php.net/get/oauth-1.2.3.tgz
tar -xzf oauth-1.2.3.tar.gz
cd oauth-1.2.3
/usr/local/bin/phpize54
./configure --with-php-config=/usr/local/bin/php54-config
make
cp modules/oauth.so ~/openphoto/pecl/
echo "extension = oauth.so" >> ~/openphoto/src/html/php.ini
# install imagemagick
cd ~/pecl_install
wget http://pecl.php.net/get/imagick-3.1.0RC2.tgz
tar -xzf imagick-3.1.0RC2.tgz
cd imagick-3.1.0RC2
/usr/local/bin/phpize54
./configure --with-php-config=/usr/local/bin/php54-config
make
cp modules/imagick.so ~/openphoto/pecl/
echo "extension = imagick.so" >> ~/openphoto/src/html/php.ini

Create the Webapp

Create a new web application at the WF control panel.You want a “symbolic link” application that points to ‘/home//openphoto/src/html’. The app type is “Symbolic link to static/cgi/php54 app”.

Once you’ve done that, add the new app to a website.

Create the Database

Go to the webfaction control panel and create a new MySQL database.

The database name and user are typically ‘_name’. The control panel will give you the password.

Hi, it’s me interrupting here. This is where I add a procedure I was missing:

Create an .htaccess file and place in '/home/<user name>/openphoto/src/html'.
Contents of .htaccess file:

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)\?*$ /index.php?__route__=/$1 [L,QSA]

Setup Openphoto

At long last, we’re ready to setup openphoto!

Go to your openphoto website and follow the instructions.

  • http://twitter.com/vinayaugustine Vinay Augustine

    Glad you found it useful! (I found your page while trying to figure out how to upgrade openphoto)