I am using a drupal installation(click-to-deploy) on google cloud. With the clean installation I can add modules by going to "Install new module", entering the url of the package and then pressing the Install button.
But when I install a theme I purchased (by copying over the sites/all and sites/default directory and restoring a saved backup) and try the same steps I get taken to the Update manager (authorize.php) page. It also asks for my ftp information. A warning displays "WARNING: You are not using an encrypted connection, so your password will be sent in plain text. Learn more."
Obviously the files I copied over changed some settings but I am not sure which ones.
Any suggestions on what to try?
Although the messages in drupal weren't helpful I solved it by changing the user/group to www-data for all the directory+files.
Related
I would like to edit the WordPress files before installation to my needs.
For each WordPress installation I am changing certain settings, pages, posts and the theme. So I would like to make these changes once and have my changes applied by the installation.
Here you can find the normal WordPress files: https://de.wordpress.org/download/#download-install
I followed this post to stop posts and pages from being created and also found some code in wp-admin/includes/upgrade.php to define pages to start out with.
How to delete the default hello world post BEFORE Wordpress install
From this post I took the info to set the starting theme, which can be found in wp-includes/default-constants.php. But that post had a warning to "NEVER EVER edit the CORE files" – kanlukasz
Set WordPress default settings before installing
So my questions are:
How to activate plugins on installation?
How to edit the settings on installation, like time format, media upload format and avatar format-> false
How to properly set the theme before installation?
Happy for every answer or pointers to other topics.
There's three main parts to a WordPress install, which I'll generally (although arbitrarily) identify as pre-work, installation, and setup.
The commands below assume you have WP-CLI installed and available on your system. They make no assumptions about your server, be it Apache, Nginx or IIS (except for rewrite which only works with Apache). At our company we actually use the Symfony CLI binary for local development server since we get a TLS cert and proxy.
As noted in the comments, you can also go down a different path using composer, and the most common one is probably the Bedrock install. I'm not going to touch on that, they've got plenty of documentation.
Pre-work
In this phase you need to get the database setup, create the directory to hold WordPress and download it, and create a wp-config.php file. You can do all of this from the CLI, too, although your commands might vary for the database depending on your version and flavor.
In this example I'm creating a database named t_low with a username and password of the same.
# Setup database
mysql -uroot -p -e "CREATE DATABASE t_low; GRANT ALL PRIVILEGES ON t_low.* TO t_low#localhost IDENTIFIED by 't_low';"
# Download WordPress
mkdir t-low
cd t-low
wp core download
# Create config
wp config create --dbname=t_low --dbuser=t_low --dbpass=t_low
Installation
This is fairly straight-forward, pretty much the options you'd see if you went through the web GUI. On development sites I don't bother with passwords because they just clog up my password manager, too, but could be provided here if you want to.
# Install WordPress
wp core install --url="https://t-low.wip" --title="Demo Site" --admin_user="person#example.com" --admin_email="person#example.com" --skip-email
Setup
At this point, WordPress is technically installed, so this is where you can change/tweak/delete things like plugins, themes and settings. Obviously don't run all of these blindly, take a moment to think through what they do and if they are applicable for you. Most of these are part of my company's default install.
# Install and optionally activate plugins
wp plugin install health-check --activate
wp plugin install one-time-login --activate
# Remove existing plugins
wp plugin delete hello
wp plugin delete akismet
# Remove extra themes
wp theme delete twentytwentyone
wp theme delete twentytwentytwo
# Turn on debugging
wp config set WP_DEBUG true
wp config set WP_DEBUG_LOG true
wp config set WP_DEBUG_DISPLAY true
# Delete sample data
wp post delete $(wp post list --post_type='post' --format=ids)
wp post delete $(wp post list --post_type='page' --format=ids)
# Set rewrite structure
wp rewrite structure '/%year%/%monthnum%/%postname%/'
# Disable avatars
wp option set show_avatars 0
# Change the time format
wp option set time_format "Y-m-d"
Your next question might be "how do I know what options to change" and that one is trickier. Sometimes you can just run wp option list and find an option that is obvious to change. Other times you might need to run that command and save the output somewhere, make the change in the GUI backend, then re-run the command to see the difference.
With all CLI commands you can append --help to get a better understanding of things. You can also find info online, but I think the CLI is more descriptive.
There's also several third-party WP CLI packages to install that you might find helpful, and some plugins even ship with their own. For instance, on most of my sites I install the one-time-login plugin wp plugin install one-time-login --activate so that I can do wp user one-time-login chris#example.com to get a magic login link and not have to worry about passwords.
Lastly, you can very easily write your own commands. There's a little bit of boilerplate stuff that you need to get down, but otherwise it is pretty straightforward WP/PHP code then.
Also, for plugins that aren't in the main directly you can still install them via a zip file or URL:
wp plugin install file.zip --activate
wp plugin install https://example.com/file.zip --activate
Some of those plugins, such as ACF, allow you to store activation keys in wp-config.php, which is really awesome. This is not universal, however, and totally up to the plugin developer.
wp config set ACF_PRO_LICENSE "XYZ"
I'm using valet+ and Wordpress 5.9 on a local environment.
I have a simple task of updating some new terms of my payment module.
They are located under wp-content/plugins/my-plugin/languages/my-plugin.* where * represents .pot and -pt_BR.mo and -pt_BR.po files.
Some old terms are still working in the admin, even if I remove everything in this folder and refresh the page. The new terms are not being translated at all.
I already tried to restart valet (php, nginx, etc), and also used wp-cli cache flush command.
Am I missing something here? Or is there any other place to look for translation cache that I am leaving behind?
It turned out that wordpress was loading another file located under wpcontent/languages/plugin/my-plugin.*.
Removing those files solved the problem. No cache cleaning or restart was needed on local environment.
Not sure if i'm at the right place but oh well,
Since a month or two I've started working at a company which uses Magento. Everything was going smoothly, except for the fact that I now try to add an extension to the root directory of Magento through cPanel, in the installation guide I found the following steps:
Installation:
Before installing the extension, please make below notes complete:
Clear your website cache under located at var/cache directory.
If you’re installing extension on live website, please backup your store database and web directory.
Disable Compilation by going to Admin Control Panel -> System -> Tool -> Compilation.
Multi PRODUCT EDITOR Installation:
Extract Multi_Product_Editor-1.0.0.tgz file.
Upload the extracted folders (/app, /js, /skin) respectively into the root of your Magento installation.
From the Admin Control Panel, refresh cache at System => Cache Management. Log out and log in back
now I have found a problem with uploading the extracted folders, because
There are already a folder called App and one called Skin and I'm not sure if I should overwrite those
When I wanted to upload the specific folders, it can't, I can't upload the folder "App" and it only allows me clicking the folder and searching through the folder's folders.
I'm still new to Magento but I learn everyday! please tell me if I'm doing something wrong or if I need to take a step back, I gladly appreciate all your help!
Also, if I wasn't specific enough, or if you need more details, just say so and I'll try adding as much as I can :)
kind regards
Clay
In magento app and skin are mandatory folders so you must not erase them. But if your module you want to add is adding properly, it will just add based on magento structure and create a new module in community or local for the app, and a new design in skin.
Be always careful of where the modules installs things anyway
I am brand new to Drupal and was looking around to find issues related to mine, but I have cloned a repo of a Drupal build so that i can collaborate with my team and also install it locally using MAMP.
I was able to clone it successfully into my htdocs folder, but when i went through the Drupal installation process I got the following errors see below in grey since i can't post an image because I don't have a 10 reputation yet.
File system The directory sites/default/files is not writable. An
automated attempt to create this directory failed, possibly due to a
permissions problem. To proceed with the installation, either create
the directory and modify its permissions manually or ensure that the
installer has the permissions to create it automatically. For more
information, see INSTALL.txt or the online handbook.
and
Settings file The settings file is not writable. The Drupal installer
requires write permissions to ./sites/default/settings.php during the
installation process. If you are unsure how to grant file permissions,
consult the online handbook.
Naturally I don't know what this means and was wondering what kind of problems I could expect if just ignore it, or better yet how to just resolve it and not go the route of unexpected errors later.
Any help on what this means or how it affects the install I would really appreciate.
Finally Drupal didn't ask whether an SQL database was installed and I'm not sure if that would've installed with the clone (I suspect not) but don't really know any advice on whether i should just get the SQL file from the Admin or if it is installed would be helpful.
Thank you.
A clean Drupal installation process includes creation of required tables (you provide the db username, password, host & db-name). Drupal also needs write permission on sites/default/files directory (It stores user uploaded stuff & cache related files).
You can know more about securing file permissions here: https://drupal.org/node/244924
For a local install what I do is, give 777 permission to sites/default directory. Later I change the permission of the settings.php file to 555 to get get rid of drupal warning messages.
For *nix machines, you can do chmod -R 777 sites/default
NOTE: this is just a quickfix and okay for local setup. Please set file permissions wisely in production/server setup.
i am moving in to the world of PHP for my company and i am having some issues. Now i have very little experience and i would love some help to get me to understand how it works.
My first problem is that i am trying to setup a sales page for my product, and i want a the open inviter script to pop up to "invite your friends to see this page for an extra free bonus" (only when the customer wants to buy my product, so there is no spamming going on here)
But for the last 5 days i have been trying and trying and i simply cant get it to work, the inviter just appears blank whatever i do.
Now i might know where the problem might be because i located it tooday, the open inviter i had was modified but i found the original and it had the requirements:
"Your server will need to have PHP5 installed with DOMDocument support and either cURL or WGET."
I found out that my hosting company supports php5 if i place a line through a .htpaccess file. but the rest like domdocuments or cURL is something i just seem to understand how it works, i have looked through hundreds of websites trying to figure this out but i cant get a simple enough explenation on what it really is and how i get it to work with my hosting.
Do anyone have an idea on how i can get my open inviter installed on my website?
Here is the installation details:
"Thank you for downloading The OpenInviter General Package. This document will guide you through the installation process.
A: Requirements:
Your server will need to have PHP5 installed with DOMDocument support and either cURL or WGET.
B: Install:
1. Extract the contents of the openinviter.tar.gz file you have just downloaded.
Note: tar -xzvf openinviter.tar.gz
2. Upload the extracted files to your webserver (subfolder is highly advised).
3. Run postinstall.php (http://yourdomain/openinviter_dir/postinstall.php)
You may encounter the following errors:
i) The cookie storing folder if not writable. (Change the cookie folder or modify it's permisions.)
ii) Php DOM extension is not installed. (Install dom extension for php)
iii) You don't have curl or wget installed. (Install curl or wget)
You may encounter the following warnings:
i) A plugin does not work properly. (Your server has either a firewall or there is a connectivity error)
Note: You have to fix all the errors or openinviter will probably not work.
Note*: You can't run postinstall.php again for 2 minutes.
Edit config.php to suit your needs.
Delete postinstall.php
Run example.php (http://yourdomain/openinviter_dir/example.php) and try to fetch your contacts.
Note: example.php is modifiable but keep in mind the structure of the file."