Error Importing Files

Hey guys,

Also, I was trying to export my files from my site and did it incorrectly. I basically dragged them out of the folder onto my desktop thinking it would make a copy. Then when I tried to drag them back onto Local, this error message keeps popping up. It is the exact same file folder I just dragged out of Local, so I am unsure why Local cannot upload these right back into the platform. Help!

You dragged the files from Local Sites/site_folder/app/public onto your desktop and then dragged them back to the same folder? That process shouldn’t create any issue. But I see your Local Sites shows 2 sites with the same name.

I’m apparently failing to understand the situation well… But just describing: You had one site, you wanted to export the website, so you opened the site folder on Local Sites and dragged the entire folder of your website to the desktop, then dragging it back on Local Sites folder once you saw it wasn’t right.

If that’s so, it seems like Local is reading your dragged folder as a new website import.
The manual export method involves a zip file with the contents of the app/public folder and a database.sql (which is the database dump that you can make from Adminer) files inside it.

To describe Local by Flywheel “automatic” export method, you just right-click on the site’s name on the app and click “Export” and it will create a zip file with the files and database inside.
Both zips (from manual or “automatic”) can be dragged directly inside Local’s app and be imported as a New website. If you want to “override” the website, you will need to delete the old one, and import the new one (but just do it if you know you have the right export file).

This post below may help you:

Just be careful to not lose your work. If you delete your website without a proper backup of files and database, it might be really hard to recover it.

If you have any trouble or questions, just fire away, I’ll be notified :smiley:

Hi!

So I’ve been playing around since I posted my topic. I’ve somehow gotten it to work again on a new site, paradoxsports20182.local, but had to edit a file to increase the memory size.

However every time I edit the homepage now for this new site (it was doing it on Paradox’s ports2018.org too earlier today before I ran into all of these issues), when I go to preview it none of the content is there. Is this still a memory issue? I have it set in wp config to 550M right now and the site isn’t even live yet.

Bayley

Hey,

Before editing you can see your homepage?

If your database is configured correctly, and you edit it, Wordpress writes those edits on the database and they are loaded upon accessing the page. That is the way it works.

Do you use any Visual Builder? Like Visual Composer or similar? If so, you could be running into a max_input_vars problem, so you need to edit the php.ini file to increase the number (put 5000 or more). It is a safety config, so the php only pass a limited number of variables to the database, it mitigates the issue with high loads of data being transfered, so your database and php processes don’t struggle.

If you’re able to, export your Local by Flywheel logs (How do I retrieve Local’s log file?) and PHP logs (they are located in Local Sites/site_folder/logs/php/php_version_folder/error.log) and upload them here so we can take a look :smiley:

So when I open the site, the homepage loads but the body of the content is missing. The layer slider is there, the header, the footer, but the containers do not show up. I deleted some files and it was working, then the site got super slow again tonight and parts of the homepage disappeared again.

I use the Layer Slider for the header images on my pages and the Fusion Builder to build the pages in Wordpress.

I tried attaching those files, but the php file is 375MB and would take an hour to attach to a shareable Google Drive. Is there anyway you can screen share with my computer and open the file that way?

local-by-flywheel.log (658 KB)

The error.log file is 375mb? Wow. That might be the most important piece of this puzzle haha. Try to open the file in notepad or a text editor, and copy the last, say 50 - 100 lines. You can paste them here or create a new file with just them (better create a file, so the forum is kept clean)

error.log

Hi!

This is the error log. Let me know what you can find, since the file is massive.

Thank you so much!

Bayley

https://drive.google.com/file/d/1l2ukS6H8tpIj5zb1eKQnNMiIr-dDeeAA/view?usp=sharing

Bayley,

Viewing part of the log file (since it’s massive I was only able to see the last lines below)

[25-Sep-2018 21:02:35 UTC] PHP Fatal error: Allowed memory size of 268435456 bytes exhausted
(tried to allocate 134217736 bytes) in /app/public/wp-includes/formatting.php on line 604
[25-Sep-2018 21:05:16 UTC] PHP Warning: Use of undefined constant ‘WP_MEMORY_LIMIT’ - assume
d ‘‘WP_MEMORY_LIMIT’’ (this will throw an Error in a future version of PHP) in /app/public/wp
-config.php on line 66
[25-Sep-2018 21:05:16 UTC] PHP Warning: Use of undefined constant ‘512M’ - assumed ‘‘512M’’
(this will throw an Error in a future version of PHP) in /app/public/wp-config.php on line 66
[25-Sep-2018 21:05:19 UTC] PHP Fatal error: Allowed memory size of 268435456 bytes exhausted
(tried to allocate 4096 bytes) in /app/public/wp-includes/shortcodes.php on line 358
[25-Sep-2018 21:05:19 UTC] PHP Warning: Use of undefined constant ‘WP_MEMORY_LIMIT’ - assume
d ‘‘WP_MEMORY_LIMIT’’ (this will throw an Error in a future version of PHP) in /app/public/wp
-config.php on line 66
[25-Sep-2018 21:05:19 UTC] PHP Warning: Use of undefined constant ‘512M’ - assumed ‘‘512M’’
(this will throw an Error in a future version of PHP) in /app/public/wp-config.php on line 66
[25-Sep-2018 21:09:16 UTC] PHP Warning: Use of undefined constant ‘WP_MEMORY_LIMIT’ - assume
d ‘‘WP_MEMORY_LIMIT’’ (this will throw an Error in a future version of PHP) in /app/public/wp
-config.php on line 66
[25-Sep-2018 21:09:16 UTC] PHP Warning: Use of undefined constant ‘512M’ - assumed ‘‘512M’’
(this will throw an Error in a future version of PHP) in /app/public/wp-config.php on line 66
[25-Sep-2018 21:09:18 UTC] PHP Fatal error: Allowed memory size of 268435456 bytes exhausted
(tried to allocate 134217736 bytes) in /app/public/wp-includes/formatting.php on line 604
[25-Sep-2018 21:34:38 UTC] PHP Parse error: syntax error, unexpected ‘}’, expecting end of f
ile in /app/public/wp-config.php on line 66
[25-Sep-2018 21:34:39 UTC] PHP Parse error: syntax error, unexpected ‘}’, expecting end of f
ile in /app/public/wp-config.php on line 66
[25-Sep-2018 21:35:20 UTC] PHP Fatal error: Allowed memory size of 367001600 bytes exhausted
(tried to allocate 50333072 bytes) in /app/public/wp-includes/shortcodes.php on line 435

So your problem is that you apparently have some misconfiguration on your wp-config.php file.
You have a constant defined on your file at line 66 that limits wordpress memory usage, this is not there by default. If you tried to put that code that to limit Wordpress from using a lot of memory, I recommend you limit PHP’s memory (in php.ini), not Wordpress.
You might have written it wrong or some other code there is in this file that is causing the error.

Also, your error.log is massive because it is printing your entire database, probably multiple times, and for some reason it has lots of empty <p>.

You should review your wp-config.php file, and delete or comment everything that is not there by default, so you can try to run Wordpress with no problems.
You can use this as base: https://github.com/WordPress/WordPress/blob/master/wp-config-sample.php (it’s Wordpress original wp-config sample file, that displays everything that comes by default in that file)

After that you can try to run the website, and see if you can edit anything, to see if your content is right. Also, you should open php.ini file in Local Sites/site_folder/conf/php/php_version/php.ini and edit the memory_limit variable to be able to allocate more or less memory to your site.

Wordpress memory limit is recommended for usage only if you know completely what you are doing, don’t have access to php.ini, or are running multiple sites in the same server, and you don’t want one to use more memory than the other, so you split it for them. But since you are running only one, it’s better to limit PHP’s memory usage.

See if any of this helps you. If you have any questions I’ll be here.
Good luck! haha

Makes total sense. I will delete the memory size code in the wp-config file. However I cannot find the php.ini file anywhere in that folder. I attached a screenshot of what I can see if you can help me out with this!

Also, I definitely did not drag that error.log I sent you back into the folder as you will see in the screenshot. But the site was working, despite it running very slowly. Do I need that error.log back in the folder and if so is there a sample file like the one you sent me for wp-config file that I can use to start over instead of trying to drag that massive file back into the site folder?

Thanks!

Bayley

About the php.ini, it should be inside the “conf” folder. In your screenshot, you are in the logs folder, that is not the correct folder.

About the error log, definetly don’t drag it back. The system simply creates a new one if the file is not there, as you can see, there’s already a new one. So there’s no need to do anything for this.

Also, for your site to be running that slow, there might be something eating up your memory. You might want to use a performance plugin (like P3 or a similar) to see what is using all those resources in the website.

Okay so I cannot find the php.ini file anywhere. There is no conf folder there either. Any other suggestions?

Ok, I know why that is happening. You are using the Preferred Environment, right? To be able to edit PHP configuration you need to have the Custom Environment configured. You can change that in the Overview tab, into Local Environment. Backup your site first just to be sure (right clicking in your site name and clicking “Export”).

That way, your site should have a folder structure similar to the one below:
image

From there you can edit the php.ini file. Sorry for the confusion… I forgot about the environment haha.

So the only problem there is if I use the custom environment apparently it will not let me connect and push it up to Flywheel who will be hosting it.

You’re safe to use WP_MEMORY_LIMIT in wp-config.php but note that the wp-config.php file will not be pushed and pulled from Flywheel.

If you need a higher memory limit on Flywheel than what your site already has, you can contact support. :slight_smile:

1 Like