Fresh Wordpress install on Amazon Linux EC2...can't delete and reinstall - wordpress

I just recently started by creating a EC2 instance on AWS. I used the Amazon Linux package. I changed the PHP settings to include the ability to upload files larger than 200MB. Got phpinfo.php working. Installed phpMyAdmin. Everything looked good.
Next, I installed Wordpress. It worked great. Then I tried installing a theme. Worked great. Then I started installing some plugins for that theme. Something made the site crash. I tried a few things, but since I couldn't go to the sites Wordpress Admin panel, it seemed hopeless. So I decided to start from scratch. I deleted the html directory (including wp-content) and dropped all the wordpress tables. I moved a fresh copy of Wordpress into the html directory, reconfigured the config.php file, and it recreated the Wordpress tables in the database. Seems to work great. When I try to upload a theme, it says:
Connection Information
To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host.
I noticed that wp-content didn't have a uploads directory, so I created one. That seemed to let me upload the theme, but it showed up as a media file. I moved it to the theme directory and that worked. But when I tried to upload a plugin, I got the same message as a above.
What happened when I deleted everything? Or rather, where was information stored that when I reinstalled Wordpress, it didn't create a uploads directory? I am fine with reinstalling Wordpress from scratch, but I don't want to reinstall the whole LAMP stack or redo the AWS instance. Any thoughts?

The issue is that your web server doesn't have the proper permissions to write to your content directory.
The WordPress Codex has some good info for proper file and directory permissions. Ideally, all files should have 644 permissions, and all directories should be 755 (no higher).
If you're still running into issues adding plugins and updating WordPress, you should heed the advice of the following (so that you don't have to enter FTP details into WordPress each time):
Any file that needs write access from WordPress should be writable by the web server. If your hosting set up requires it, that may mean those files need to be group-owned by the user account used by the web server process.

Related

Can't Update ANYTHING on Wordpress site

I have a working version of Wordpress on my home Synology web server, and I can view the site and post comments etc without any problem.
However, I cannot update any plugins or themes and also can't add any new plugins or themes. I keep getting the error saying "Installation failed: could not copy file..." The name of the file it fails to copy changes each time.
I have verified that I do have FTP access and all my permissions across the files/folders seem to be precisely correct (664 for files, 775 for folders).
The only seemingly significant bread crumb I have found is this: Checking my FTP transfer log files, I see that there are files being added to the correct directories BUT then they are IMMEDIATELY being deleted from those same directories ('put' followed by 'delete'). So it seems like it is connecting to the web server, installing the files, and then immediately uninstalling everything!!
I sincerely appreciate any help!
Thanks,
Bryan

WordPress website pages are redirecting to adult site pages

I have a website built on WordPress platform. Today, when I opened the website and when I clicked anywhere on the website, adult site pages are opening up continuously.
Can anyone please suggest what could be done to resolve the issue?
Your site is hacked by someone and some script injected in your WordPress installation or database which causing to load this video your website need to scan your website using plugin like SECURI You can get this on Securi.net
Here are some solutions that you can try(Remember to take a backup before using this)
Check and clean all your recently modified files
Contact your hosting provider if you are not using dedicated server.
If you have some inactive themes and plugins which you don't need more remove them.Hackers can hide script there.
-You can upload new word-press core files which you haven't customised.
Install fresh copy of themes and plugins if you not customised them.
Change your secret keys in your wp-config file.
Check users in your word-press and delete suspected ones.
Check permission of your installation directory .if not secure them make changes.
Change you WordPress password
If this all not works to solve problem let me i will look into it.

wordpress database not showing in PhpMyAdmin

I am new to wordpress and have bought udesign theme from themeforest. from my Plesk I have installed WP and then from the dashboard of WP tried to upload the theme, but failed. hence went directly to dedicated server and hosted on the root folder.
Theme started reflecting on the dashboard and I have started customization. Once site completes I need to move the site to production server. When I check PhpMyAdmin from the plesk, it shows there is no DB table. how do I copy/move the site without DB?
Can i manage site without PhpMyAdmin? like copying the entire assets to new server and it starts working automatically?
Please help me to find DB or Let me know how to work with the themes to make sure everything in right place.
Many Thanks,
Gururaj
If you’ve ever had the need to find the name of your WordPress database, then there’s an easy way to do that – simply look for it in your wp-config.php file located in the root folder of your WordPress install.
Accessing Your WP-Config.php File
If you are doing something where you need the name of your database, then I’m assuming you have access to your server.
Simply go to the main folder of your WordPress install and locate the file called wp-config.php.
Edit file and find name in:
define('db_name','your database here');

Will Deploying Git via Beanstalk affect WordPress Upload Directory Permissions?

I've got a WP site in a workflow that goes local--> git (beanstalk) --> dev server.
Everything seems to be working fine when I deploy, but I've noticed that I can't upload images via WP and it seems like it's a directory permission issue.
The error I get is: "The uploaded file could not be moved to /path/blah/blah...
Is this because the FTP user doesn't 'own' these directories/files (because they weren't created via the WP site / FTP account of the dev server?
Please let me know if you've got any brilliant work-arounds or insights. I'm stumped.
Thanks in advance.
This is because Beanstalk uses ftp to upload your files, that means the owner becomes the FTP user. If Wordpress then wants to access those files, it is no owner so it can't delete/alter them. You can use chown apache <filename> on SSH if you want to make apache (wordpress) owner again. But now Beanstalk can't overwrite the files for the same reason.
The way to go is use a .gitignore file to ignore folders like uploads and cache. You don't need them locally for development, if you do, just grab them once with ftp.
I use this one myself with some additions. It may seem weird at first, but it rocks when it all works. :)

Mirroring a Wordpress *configuration* between local and remote

Ok, so I'm familiar with creating local Wordpress builds, and have been chugging along happily with the technique outlined in Smashing's MAMP-based article. My question goes a step beyond this.
The article is great for developing generic themes, but when developing sites (not necessarily blogs) based in Wordpress, for me at least, it's a little painful come launch day.
I have to go back in and reconfigure the server's Wordpress to match what I've already done locally. Settings have to be entered again, plugins need be installed again, menus recreated, and css will have to be altered to reference the unique classes/id's Wordpress generates for posts/pages/custom taxonomies…sometimes things are missed in the process. What I want to know is this:
Is there an easy way to automate cloning or mirroring the build on my local machine to the remote server?
Even if you have to just LMGTFY me, that would help. I don't exactly know what I should be searching for. Searches dealing with 'mirroring wordpress configuration' and 'cloning wordpress configuration' returns tutorials on moving content, which I know how to do.
If it helps, I'm running OSX 10.6.8 with xcode dev tools, git, ruby, node, and homebrew. All of my live servers have ssh access as well as ftp, and I build with the most current versions of Wordpress.
Here are some easy steps to follow:
Download and install the WP Migrate DB plugin.
Go to Tools > WP Migrate DB and fill-in the blank fields(New address (URL), New file path and optionally check/uncheck the other options). Click on Export Database and save the export file to your computer.
Make a .zip archive with ALL of your files(the /wp-admin, /wp-content, /wp-includes directories and all files in the root directory).
Upload that file to your production server, where you want your WordPress site to reside.
Go to your cPanel(or use the unzip command through SSH) File Manager(or any other alternative that you might have) and unzip the file that you just uploaded.
If you don't already have a Database set-up on your production server - create one through the hosting control panel(for cPanel, it would be Creating a mySQL database in cPanel, for plesk it would be Plesk 7 Tutorial: Creating a database, for anything else, just google it up, or try your hosting's FAQ). Remember/write-down your Database Name, Database User and Password.
Edit the wp-config.php file and change the values for the DB_NAME, DB_USER, DB_PASSWORD and optionally DB_HOST - but this is usually localhost - if that doesn't work try asking your web host, or if you have phpMyAdmin, log-in to it and look at the very top of the page - in this case the DB_HOST would be localhost.
After you've done all of that, log-in to your DB administration tool(most of the time this would be phpMyAdmin, but it could be something else as well) and upload the database export file that you save to your computer in step 2. Note: If your hosting hasn't provided you with a DB administration tool, I would suggest that you upload the phpMiniAdmin(click on the "Download latest version" link and save the file to your computer) script to your production server. Then go to that script(if your website is located at http://example.com/, go to http://example.com/phpminiadmin.php) and enter your DB details. On top of that page, you will see an import link. Click on it and upload your DB export file. Note 2: phpMiniAdmin doesn't support gzip-compressed files, so if you did check the Compress file with gzip option in step 2, you will have to re-do that step with this option unchecked.
Log-in to your site and go to Settings > Permalinks in order to update your permalink structure.
Check the permissions of the /wp-content/uploads and /wp-content/plugins directories - make sure that you will be able to upload images and plugins without any problems.
That's pretty much it. It might seem like a lot, but I follow this process for almost every site that I upload to production servers and it can take me as less as a bit under 10 minutes to do all of that(considering that I usually use custom MySQL commands, instead of the WP Migrate DB plugin - I should probably start using it :) ). Once you get used to the process and you don't encounter any low-quality web hostings, you should be perfectly fine with these steps.
Note: Since you used ssh as one of your tags, I assume that you usually have ssh access to the production server. If you don't I'm still assuming that you have a cPanel access(if that's not true and you can't unzip files on the server, then upload all files manually via FTP client, instead of doing steps 3 and 4).
I guess the only way is to copy the database or part of it.
What I do is to copy the relevant tables and modify manually the site URLs in table options. There are only 2. There is also a nice plugin velvet-blues-update-urls to modify all links, after the site URLs are set manually to be able to access the backend, in case posts are also copied.
Next, copy all theme directory files to the same directory in the site, assuming you are using the same theme.
Both processes can be automated with a PHP script.
I am not sure this is what you want, but hope this helps.
Not sure that this is exactly what you need, but to move a site you can use the built in Wordpress "export" and "import" options. As far as I remember there was an option when importing to change URL's and the import would change a few things for you.
Even if this does not answer your exact question, hope it helps.

Resources