Wordpress theme breaks when I migrate to live server - wordpress

I have created my own theme which works just fine locally, but when I try to migrate it to a live server the links break.
I've gone through the usual channels: permalink changes, database search & replace using new url, plugin deactivation etc etc, but no joy. It works fine with bog standard themes so I know the theme is the problem and not the database, but just can't pinpoint where the problem is. I've searched through the functions file but can't see any problems there either.
I've created themes before and never had this issue - I've looked through other questions but not found a resolution. Anyone else experienced this?
EDIT:
After adding
error_reporting(E_ALL);
ini_set('display_errors', 'On');
to wp-config.php
The following error was seen:
'Parse error: syntax error, unexpected end of file in /home/museumweb/public_html/wp-content/themes/museum/page.ph‌​p on line 40'
Which has been fixed now.

For general server 500 errors, always try adding:
error_reporting(E_ALL);
ini_set('display_errors', 'On');
to your wp-config.php file. After solving don't forget to remove it ;)

Related

Elementor Plugin on Wordpress keeps loading and I get a console error /wp-admin/admin-ajax.php 500

how are you?
My website was working well and now I'm unable to create or edit pages using elementor because the 'loading' keeps spinning and nothing happens.
I see a console error where I get /wp-admin/admin-ajax.php 500
How can I fix this? I don't know what caused it.
Thanks!
there are many reason for this. But the common one is WP memory limit issue.
To handle this, first you need to edit the wp-config.php file on your WordPress site. It is located in your WordPress site’s root folder, and you will need to use an FTP client or file manager in your web hosting control panel.
Next, you need to paste this code in wp-config.php file just before the line that says ‘That’s all, stop editing! Happy blogging.’
define( 'WP_MEMORY_LIMIT', '256M' );
This code tells WordPress to increase the PHP memory limit to 256MB.
Once you are done, you need to save your changes and upload your wp-config.php file back to your server.
I had this problem too, I just disabled plugins one by one and I found the problem!
one of my plugins caused this problem.

how to solve wordpress wp-admin cookie blocked error?

I am working on wordpres site, site works good but whenever i try to login using wp-admin it shows me error called "cookies are blocked due to unexpected output" and i can see one of the text "password" return on left top area of wp-admin screen.I tried to change password from phpmyadmin but it does not works. can any one help me out for this.
Thanks in advanced
Turn on Debug info by adding following code in wp-config.php
define('WP_DEBUG', true);
It will show you what code might by causing the issue.
Also read this thread please people with same issue have solved:
https://wordpress.org/support/topic/unable-to-log-in-cookies-are-blocked-due-to-unexpected-output?replies=37
If this is happening after moving a multisite to a different domain (for dev purposes for instance) then make sure you edit the following line in your wp-config.php file and change the previous domain to the current one:
define('DOMAIN_CURRENT_SITE', 'newdomainname.com');

Wrong path within plugin files

I'm running the latest version of WordPress (3.5.1), hostet with Strato and since yesterday some of my plugins are not getting the correct path to their files.
UPDATE: It's not a Multisite!
All files are still on the server and haven't been changed or updated since friday (at this point the site was live without issues). The problem is that the plugins are looking at some kind of internal path which looks something like this: website/wp-content/plugins/xxx/xxx/xx/xx/123456789/htdocs/website/wp-content/plugins/akismet/akismet.css so all I get is an error 404 (Not Found)
I cannot locate the problem and I'm not getting any PHP errors or anything like that; only the paths are broken... the plugins are even working, but without images, css and scripts!
Therefore I've deactivated all of the plugins but as soon as I activate them again, I'm running into the same problem.
And finally I've already contacted the provider, but they cannot help at all because it seems to be a problem within WordPress.
UPDATE: I've completely removed all of the plugins, but even if I now download and activate a new plugin the path is broken as mentioned above...
UPDATE2: The wrong path looks like this:
domain.com/wp-content/plugins/mnt/web1/a1/12/123456789/htdocs/
/website/wp-content/plugins/akismet/akismet.css
instead of domain.com/wp-content/plugins/akismet/akismet.css
(actually the second version of the path is working, but all of the plugins are calling the first version, even if completely new installed)
UPDATE3: Sorry, I'm not able to go more into detail, because I've no clue what's going wrong, so I'm giving it a try from another perspective: everything is working fine, with the exception of the plugins. The plugins are even displayed in the frontend, but without any CSS, JavaScript or images. The same thing happens in the backend. I can see all of the plugins and manage (install, edit, configure,...) them, but there is no styling. Everything in case of the design seems to call a wrong path. In doing so the first part of the path is okay, and also the last part, but in the middle there are numbers which should normally not be displayed within a frontend path because they are a part of the Strato server root directory.
It seems your the WP_CONTENT_URL is not correct.
This is defined as in ./wp-includes/default-constants.php:
define( 'WP_CONTENT_URL', get_option('siteurl') . '/wp-content');
So check your settings > general > WordPress Address (URL)
You can also try to define the correct WP_CONTENT_URL in your wp-config.php:
define( 'WP_CONTENT_URL', 'http://www.yourdomain.com/wp-content');
When the above don't help check your .htaccess. Maybe wp-content/ is rewrite to the fullpath.

Wordpress HTTP 500 on theme change

i just:
moved a remote wp network installation to local (mamp). everything fine.
installed a new theme. everything fine.
activated the new theme. doh!
i started going through the code and i found that it doesn't fix it, but at least i got a nice-relaxing-blank-white-page, if i remove the *do_action( 'init' );* from wp-settings.php.
i googled a while and i found that "*Your problem is probably wp_cron being called by init. In 2.1 and up, the cron process is called externally, so one thing that could be your problem is the DNS resolution not working on your webserver to find its own address.*"… i don't know if this could be the right answer to my issue, what am i supposed to do to fix it all?
ty!
To determine what the actual error is, you will want to turn on debugging. To do this, add the following line to your wp-config.php file:
define('WP_DEBUG', true);
It should then start spitting out lots of textual data as to what the error is. In all likelihood, it is a PHP error due to a coding issue (bad function call, missing end tag, etc.) in the new theme, or a difference in configuration between your live site and MAMP setup.
For more info on WordPress debugging, see http://codex.wordpress.org/Debugging_in_WordPress.

MAMP Drupal 6 White Page Problem

I've been trying to install an existing drupal 6 app into a MAMP environment (mac), but i get a white page as a result of the home page. The thing is that i can access to the rest of pages if i put the absolute url, but it doesn't show anything at root ( http://virtualhostname/ )! Maybe it's a question of the .htaccess and rewrite issues. I already setted up the memory_limit of php.ini of mamp and drupal to 256M so i don't think this is the problem either. Maybe is the db, cause some parts of the pages doesn't show properly, maybe at the import something went wrong, i don't know.
Its probably a php problem. Check your apache logs for the error. If you are running linux, just go to the terminal and do 'tail -f /var/log/apache2/error.log' and referesh the url you are getting the white page.
This will let you know the reason for the white page and then you can resolve it. You can paste the error over here, so that people can look and help you debugging it.
Hope this helps!!
Put these lines at the top of your index.php file, it will display the error out to the screen instead of just the white page.
error_reporting(E_ALL);
ini_set('display_errors', TRUE);
ini_set('display_startup_errors', TRUE);
UPDATE
Sounds like the 'whitespace at the end of template files' problem, details and fixes are here: http://drupal.org/node/1424
This is usually a php memory issue, but I have also seen similar situations where having an OP code cache like APC gets messed up and the usual solution is to restart apache to solve it.
Make sure you clear cache and run update.php

Resources