Ninja Forms / File Upload issue after site migration - php

I've got a Wordpress site with a Ninja form that's using a file upload add-on. The form was working just fine on my Godaddy staging server. I migrated the site to another Godaddy account and the form stopped working. Being that the hosting accounts, and all other configuration, were virtually identical, I was stumped to understand what the problem could be.
Then I checked the PHP error logs and saw the following:
PHP Warning: mkdir(): No such file or directory in /new/server/wp-content/plugins/ninja-forms-uploads/.../pre-process.php on line 203
PHP Warning: move_uploaded_file(/OLD/server/wp-content/uploads/ninja-forms/tmp/xEgbu/ninja_forms_field_3332): failed to open stream: No such file or directory in /new/server/wp-content/plugins/ninja-forms-uploads/.../pre-process.php on line 209
PHP Warning: move_uploaded_file(): Unable to move '/tmp/phpqrLDo5' to '/OLD/server/wp-content/uploads/ninja-forms/tmp/xEgbu/ninja_forms_field_3332' in /new/server/wp-content/plugins/ninja-forms-uploads/.../pre-process.php on line 209
PHP Warning: mkdir(): Permission denied in /new/server/wp-content/plugins/ninja-forms-uploads/.../processing/process.php on line 154
(FYI: the ellipsis is just a shorthand for unimportant parts of a file path.)
The thing to notice is the new/server/ and OLD/server/ conflict on the second and third PHP Warnings. For some reason, a Ninja Form script is attempting to move a file from a location on the old server to a location on the new server.
Is it possible that Ninja Forms, upon the initial installation, saved the full path of the server as a reference point in the database? If so, can that be found and adjusted without reinstalling Ninja Forms?
Thanks!
Mark

I suffered this too.
As at the end of https://ninjaforms.com/docs/file-uploads/
If you migrate from another server and the File Uploads path is
pointing to the older server location, you can deactivate then
reactivate your File Uploads and Ninja Forms plugins to reset the file
path.

Had the same issue. And while the suggested steps (of deactivating and reactivation File Uploads and Ninja Forms plugins by fiorebat) might have had some role to play but it didn't resolve the issue for me.
The problem was a really really silly thing .. UTF/Charset encoding issue. To solve that, actually type in % and/or any special characters on the Upload settings section of the File Uploads plugin.
I suspect this happens when both WP have different charsets.
Background: We were using a custom path/destination for File Uploads with %year%/%Mmonth% in the path. When we hardcoded the path to say 2019/7 it worked fine. So next, we manually typed in % (or copy from the samples show on the same page) and it custom/dynamic paths worked as well.

Related

Website not working properly since moving host. GeoIP Issue

My website used to work perfectly fine a few months ago. However, since changing host last month some parts of my website no longer work.
I am very sure the issue is related to GeoIP. My website requires the GeoIP php extension for it to work correctly. Both the old and new server have this extension enabled.
I get the following errors on my new server. Please note that the file "pdf_after_checkout_generator" is a custom made plugin.
PHP Warning: include(/usr/share/GeoIP/geoip.inc): failed to open stream: No such file or directory in /home/jksastrology/public_html/wp-content/plugins/pdf-after-checkout-generator/pdf_after_checkout_generator.php on line 18
PHP Warning: include(): Failed opening '/usr/share/GeoIP/geoip.inc' for inclusion (include_path='.:/opt/alt/php56/usr/share/pear:/opt/alt/php56/usr/share/php') in /home/jksastrology/public_html/wp-content/plugins/pdf-after-checkout-generator/pdf_after_checkout_generator.php on line 18
PHP Fatal error: Call to undefined function geoip_open() in /home/jksastrology/public_html/wp-content/plugins/pdf-after-checkout-generator/pdf_after_checkout_generator.php on line 20
I contacted my current host about this issue. I asked them what the file path is for the GeoIP extension on their server. They provided the following response (see bottom of post).
I would appreciate answers to the following questions:
I am not sure how to implement a solution. They are saying the file my website requires is not in their GeoIP extension file. Does this mean I need to install files (within the link they supplied) to my main wordpress site? then point my broken include code to the newly downloaded geoip.inc file?
I have no idea what this particular error is about. It is referencing PEAR, and I am not sure why.
PHP Warning: include(): Failed opening '/usr/share/GeoIP/geoip.inc' for inclusion (include_path='.:/opt/alt/php56/usr/share/pear:/opt/alt/php56/usr/share/php') in /home/jksastrology/public_html/wp-content/plugins/pdf-after-checkout-generator/pdf_after_checkout_generator.php on line 18
Hi there,
This would vary depending on what package you have I suspect, the
server I checked has the dat file (/usr/share/GeoIP/GeoIP.dat) present
but there is no PHP include file there.
The simplest fix would be to move the PHP dependency into the code
base of the application rather than relying on a globally shared
version. We don't as a rule install things like this globally as if it
was then updated and the API changed it would break everyone that
depended on its code.
You would need to check the .inc file on the old server to confirm but
this code is probably the code in this GIT repo so it would be simple
enough to move in to the base application -
https://github.com/maxmind/geoip-api-php
This has nothing to do with pear. The PEAR Net_GeoIP package has no geoip.inc file.
I guess that you have to put the source code of https://github.com/maxmind/geoip-api-php/ into /usr/share/GeoIP/ directory.

Error moving wordpress site

I`m trying to move my wordpress website from local computer to my new hosting. After compliting all guide steps I got an error:
Error
error: require(): Failed opening required '/home/casinost/websitename.online/www/wp-includes/home/casinost/websitename.online/www//load.php' (include_path='.:/usr/local/pear/php56') in /home/casinost/websitename.online/www/wp-settings.php on line 19
I understand that it might be some kind of path conflict of my old directory and new one, but how can I change this? Which file I need to modify to choose the correct directory?"
Wordpress always saves URLs as absolute file paths, including http:// or https://, the domain etc. This looks as if you have relatives filepaths in your wp-settings.php file which were not converted by whatever routine you used for the move to the other server. Compare those filepaths with all the other file paths/URLs which were converted correctly and change it accordingly.
Moving a wordpress site can be really hard, thats why there are some plugins for doing this with just a few clicks.
like: Duplicator
in the free version it should help you and do this task in a few minutes without headache.

PHP Form on WordPress (4.6.1) site

forgive me if is a basic question...
I am working on setting up a form on our new hosted Wordpress site - currently hosted inhouse on IIS/PHP/Wordpress server (I am not JR - but this stuff escapes me and would really like to figure it out!! I hate not knowing)
The OP that made the form / got it working is no longer around and I am sure there is a better way but this is what I have - a request form.
When I load the required files in the same path - copy the code from the WP page and paste it in the new Wordpress page - it loads without formating, the pick box doesnt look right and when I submit the form - I get these below PHP file errors. I can open the path in my browser and it exists - I see the class.GA_Parse.php file)
I checked execustion rights on the scripts - its set to execute - apart from that I dont know why it cant fine the files and that include_path I dont see via my hosting companys dir structure via FTP.
Any help would put me forever in your debt, I hope to be able to return the help, this site looks amazing!
Cheers,
Warning: require(/gaparser/class.GA_Parse.php): failed to open stream: No such file or directory in /home/comany/public_html/stage/forms/getfreetrial_v3.php on line 4
Warning: require(/gaparser/class.GA_Parse.php): failed to open stream: No such file or directory in /home/company/public_html/stage/forms/getfreetrial_v3.php on line 4
Fatal error: require(): Failed opening required '/gaparser/class.GA_Parse.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/company/public_html/stage/forms/getfreetrial_v3.php on line 4
PHP will load pages based on the disk location, not the URL. This means it's starting in the server's root / directory, not in /home/company/public_html/stage/forms. When including a file, either you have to use a relative link:
require('./gaparser/class.GA_Parse.php'); // starts in the same directory as the file
Or use PHP's server variable to get the document root:
require($_SERVER['DOCUMENT_ROOT'].'/gaparser/class.GA_Parse.php');
The paths may need to be tweaked depending on where the file actually is.

New server - Unable to create wordpress pages - Blank /wp-admin/post.php

Recently I moved a website to a new server. The website was working perfectly on the shared server, but I've encountered a host of permission issues and other problems since relocating to EC2. I have changed the ownership of the /var/www/html folder to apache to allow altering altering of settings on the back end of WordPress. Strangely enough, I am able to create new posts, but when I attempt to update an existing page or create a new one, I receive a blank page. [http://example.com/wp-admin/post/php] Originally I thought it was yet another permission based issue, but after researching that doesn't appear to be the case.
Steps I've taken thus far:
1) Changed ownership of the directory to apache
2) Disabled all my plugins
3) Added : php_flag output_buffering on to .htaccess (Although I wasn't sure if it mattered where in the .htaccess file I should put that command)
From the research I've done it appears that white space after the ?> could be the cause. Anyone know how I could tell which file would have this white space? Several of my files actually do not even have the PHP close tag. One additional note, my previous server was version 5.2.17 to 5.3.20. Any other ideas?
After checking the error logs I discovered that I was missing the mbstring PHP library, which has a function that was called by one of my theme files. Once added I was able to create and alter pages on the backend of WordPress without issue.
To all the folks who get this kind of error of page not displaying must check option.
turn on error reporting if you have commented the lines in your wp-config.php
#ini_set('display_errors','Off');
and than check for error.
if it has the error like this
PHP Warning: Cannot modify header information - headers already sent by (output started at /[server info]/wp-config.php:77)
than check your wp-config.php for extra space at top and bottom of the page.remove extra line spaces even. and than re-upload the wp-config.php.
Most of time this will solve your problem.
Happy Coding!!!!
I had a similar problem and by removing extra spaces before the "< ?php" fixed the issue. Although apparently it was a different theme functions file that was causing the issue. Make sure you look at the php file referenced in the php warning. In this example, it's 'wp-config', but it could be really anything.
PHP Warning: Cannot modify header information - headers already sent by (output started at /[server info]/wp-config.php:77)
Good luck!
Basically this issue happens because you have edited the file directly on cpanel editor or other simple text editor. Just create a new .php file and paste your post.php code in that file. Now save this file and replace this new one with old post.php.

Unable to move uploaded file - Drupal

So a client of mine recently was asking me about an issue where they cannot upload any files using Drupal.
The error they get is (and I have now reproduced it - I changed site name to preserve privacy):
warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phpwmxeOQ' to 'sites/domain.org/files/Leading_Indicators_5.pdf' in /home/isp/domain-domains/domain.org/includes/file.inc on line 629.
File upload error. Could not move uploaded file.
What can cause this? Permissions issue? Safe mode for PHP? Something else? I've not really found much in the way of searching that leads me to anything concrete. Is it just a problem with a module? Is there any way of fixing it with code?

Categories