Where to save plugins for openshift wordpress install - wordpress

I would like to upload a custom installation of openshift. I have installed wordpress and cloned it via git. Now I would like to add manually some plugins and push it back to openshift. Where do I have to put in my extracted plugins/themes?
I appreciate your answers!

Short answer: store your plugins and themes in .openshift.
Longer answer:
Every Openshift account has what can be thought of as a username - a long number like this:
53f1a90f500446c42053423083
Each directory structure features this number so yours:
/var/lib/openshift/53f1a90f500446c42053423083/app-root/runtime/repo/.openshift
will be different to mine:
/var/lib/openshift/12345678901234567890123456/app-root/runtime/repo/.openshift
The number gets incorporated into environment variables so that scripts will work on yours and mine equally. One of these is OPENSHIFT_REPO_DIR. On your install it will point to:
/var/lib/openshift/53f1a90f500446c42053423083/app-root/runtime/repo
on mine:
/var/lib/openshift/12345678901234567890123456/app-root/runtime/repo
Another is OPENSHIFT_DATA_DIR.
When you push changes from your local directory via git, the deploy script is run and it assembles all the wp files it needs into a directory it names:
OPENSHIFT_DATA_DIR/current
Openshift moves the 'original' wp plugins and themes folders that are created during a wp install into the OPENSHIFT_DATA_DIR/current/wp-content. It looks in OPENSHIFT_REPO_DIR/.openshift for your code and copies in any plugins and themes folders it finds there.
Net effect is to assemble the plugins and themes directories by adding yours to those that came with wp. So, your fully-assembled OPENSHIFT_DATA_DIR/current will have these in it:
OPENSHIFT_DATA_DIR/current/wp-content
/themes
/plugins
/uploads
So, anything you put in .openshift will be copied to the right place, but not altered.https://github.com/openshift/wordpress-example

Related

Wordpress won't allow me to download updates, plugins or themes

Two days ago we've received a project to realize for my school. We have to build a website using Wordpress.
As told in the title, I can not manage to install plugins, themes, updates and probably some things more from the admin panel.
When I try to download a theme, for example, I get the following message: "Can not locate themes directory".
However, I've been able to install two themes (actually one theme and its parent one, dont know if it matters) by downloading them as zip, and unzip in the wp-content/themes folder.
I've also added some lines to my wp-config.php file:
define('FTP_BASE', '/wordpress');
define('FTP_CONTENT_DIR', '/wordpress/content');
define('FTP_PLUGIN_DIR', '/wordpress/wp-content/plugins');
define('WP_CONTENT_DIR', dirname(__FILE__).'/wordpress/wp-content');
define('WP_PLUGIN_DIR', dirname(__FILE__). '/wordpress/wp-content/plugins');
define('WP_CONTENT_URL', '127.0.0.1/wordpress/wp-content');
define('WP_PLUGIN_URL', '127.0.0.1/wordpress/wp-content/plugins');
I am using Ubuntu with apache2, mysql and PHP7.2
Any suggestion is welcome.
check your site origin at file manager and left click to make sure that your site has permission to create/upload/etc activities

How to install WordPress locally for developing multiple websites

I have installed WordPress using Bitnami locally, I've developed a website through that.
Now I want to develop second WordPress website (locally). So, do I need to install second Bitnami WordPress or what should I do now ?
All I want is to develop new WordPress website.
I'm searching for this for about 2 days, but I am not finding relevant information, may be the words are not correct for what I want to do, please help me
I know the method of installing XAMPP and extracting wordpress files in htdocs, but since there is some problem in that , that is why I want to go with Bitnami installation.
Here is my Bitnami Folder.
Bitnami Folder contain another folder, which then contain the following stuff.
When I type localhost/wordpress then it loads my site locally, although I don't have any wordpress folder that is inside Bitnami.
Thank you every respected out there.
Hi there are 2 different ways of having more than one site locally, below is the easier way, it only takes 2-3 mins to set up. The other one, is to build up a second website under the same wordpress folder as your first website. I used both before, but now I recommend the first one, it saves time and runs faster.
Do you have the /htdocs file folder locally? like this?
And you have a wordpress.zip file some where right?
Now you can directly unzip this wordpress.zip file into htdocs folder,like this,
After you rename the wordpress folder, to whatever it needs to be,
visit: localhost/thisRenamedFolder from your browswer as you did with the other site and complete the installation
Is this the answer you are looking for?

Using Wordpress with Git - which files should I ignore?

For the past 6 or so months I have been working on Laravel projects that are closer to web apps rather than full, content managed sites.
Recently I've started a Wordpress project and there's something that baffles me, how do you use Git with WordPress?
I ask because in Laravel you can basically push everything asides from node_modules, storage and the composer vendor folder.
I have also read that it is not a good idea to store wp-config in your repository, it's a strange one as Laravel uses an .env file to similar effect.
I found the following .gitignore
*.log
wp-config.php
wp-content/advanced-cache.php
wp-content/backup-db/
wp-content/backups/
wp-content/blogs.dir/
wp-content/cache/
wp-content/upgrade/
wp-content/uploads/
wp-content/mu-plugins/
wp-content/wp-cache-config.php
wp-content/plugins/hello.php
/.htaccess
/license.txt
/readme.html
/sitemap.xml
/sitemap.xml.gz
You can ignore almost everything with the following exceptions:
wp-content/themes/my-theme (your theme and/or child theme)
wp-content/plugins/my-custom-plugin. (any custom plugins you create)
Additionally, I have found two very good sources for gitignore files for WordPress. The first which is very straightforward is on gitignore.org and the second which is extremely surgical is by Sal Ferrarello and can be found here: https://salferrarello.com/wordpress-gitignore/
Just modify as required and of course, avoid the config.php. It has install specific info such as your database host & login which you may not want to expose to prying eyes.
Laravel's .env file contains sensitive data just as WP's wp-config.php so we don't usually push it into the repo.
As to how I use Git with WordPress:
I exclude the wp-config.php file, the developer cloning the repo doesn't need it anyways: they can fill in the credentials themselves when working on the project on their local development environment. Another good reason to leave this file out is you don't want to expose your site's details (host, database name, username, password, salts, etc) to the world.
I exclude the uploads folder. The reason is that while developing we usually add dummy images to our posts and pages, images that won't be used at all when the site is finally ready for production so there's no reason to "pollute" the repo with these.
One of the things I love about Laravel is that database changes can also be tracked thanks to migrations. WordPress, on the other hand, doesn't have anything like that so you'll have to find a plugin (or some other mean) to keep your local database in sync with the staging one.
Update:
Since you updated your question to ask which files should be specifically excluded from the Git repo, I think the ones you posted from that .gitignore file you found are good enough. I don't see the need to ignore the readme.txt file though but that won't do any harm either.

Where to download Git in your local Wordpress directory?

Where would I download Git on my Local Wordpress Environment So then I can create a branch and use it as a type of test environment. and have access to the other themes?
If you are looking to test plugins and themes, it's most likely that your working directory should be established in /wp-content - it contains both /plugins and /themes. You'll want to make sure you have a .gitignore file that only tracks what you're working on.
If you are looking to work on changes to core, your working directory will almost always be the top-most WordPress root. That way, you can track WordPress/WordPress.
Actually I put my GitHub folder in my themes folder and then I could use the repos in my GitHub folder on my local host WordPress site

How to set up git for wordpress theme development

I am setting up 10 new local wordpress sites. I have 10 folders all named like this:
"name-of-site.com"
Inside each is a simple file structure:
briefing files
html
wordpress
I want to set up a repository on git hub for the wp-content file but I can't find a way to create an alias. Surely the end result will be 10 different repos all called "wp-content"
How can I set up a separate repo for each wp-content folder and name it "name-of-site.com"
Is this glaringly obvious and I am being really stupid???
Why not have the top level folted, that is "name_of_site.com" be the repository, and in that folder, you can create a .gitignore file to ignore the other directories you don't want, that is, the html and briefing files (if I understand your layout correctly). That way, you're simply tracking the Wordpress content. You can even move it up a level so that only the briefing files and the HTML are in separate directories and the WP content is in the "name_of_site.com" directory.
Edit:
After your comments, I think you could do it this way:
Create repos for each site you have and put the wp-content of those sites in the .gitignore file
Create one repo for wp-content, which contains all your themes. Organize them according to your needs.
Write a simple shell script that pulls the latest theme into your site's folder from the repo in the previous step. That way, every time you update your theme, you can go to your chosen site and just synch up with the latest pushed version.
Does that make sense?

Resources