I am new to open cart. I have uploaded a store from local to live but it says the following error
Notice: Error: Could not load language english! in /home7/neotjans/public_html/EBook/system/library/language.php on line 39
I have checked and uploaded the english.php file to catalog/language/english as it was mentioned in another tutorial but the error is still there.
I had also the same problem. You are just missing the language file in catalog/language/english/english.php. Grab it from the default file and upload it back. It will solve the problem.
If this doesn't work for you then follow the second method here
Copy web_payment_software.php file from admin\language\english\payment
Paste to your language folder. Sample: admin\language\vietnamese\payment
Note: web_payment_software.php in folder "admin\language\english\payment"of OpenCart 1.5.1.3 version. Download full package to copy it!
Related
I need to connect my mamp-Database with the craftcms files, in order to create a new website.
I put all the files for the installation of craft in the requested files. As I wanted to open the link for creating the new page, i got the error message:
The file structure you can see in the images below.
how do I change the file path correctly? Or how do I change the file structure, so the host will find it?
Thanks very much for you answer in advance
I have a line of code that is supposed to copy image from one directory to another:
copy("http://localhost:8080/wordpress/wp-content/uploads/2015/06/uploaded_background.jpg","http://localhost:8080/wordpress/wp-content/themes/landing-page/img/desktop-background.jpg");
This is located in wordpress theme header.php file, however I am receiving an error message:
Warning:
copy(http://localhost:8080/wordpress/wp-content/themes/landing-page/img/desktop-background.jpg):
failed to open stream: HTTP wrapper does not support writeable
connections in
C:\wamp\www\wordpress\wp-content\themes\landing-page\header.php on
line 42
Line 42 is where my copy function line is located.
How can I solve this issue. Any suggestions or links would help a lot.
instead of using
copy("http://localhost:8080/wordpress/wp-content/uploads/2015/06/uploaded_background.jpg","http://localhost:8080/wordpress/wp-content/themes/landing-page/img/desktop-background.jpg");
try
copy`("/yourserverfolderpath/wordpress/wp-content/uploads/2015/06/uploaded_background.jpg","/yourserverfolderpath//wordpress/wp-content/themes/landing-page/img/desktop-background.jpg");`
yourserverfolderpath/ could be something like /home/user/abc/
see you ftp or cpanel for exact path
see this SO question as guideline
PS:
In case of local file, path would be something like D:\php\www\www\xml.php
as pointed by #dlegall in comments and as per documentation, First param of copy() can be a valid URL, see the docs here
You should use a local path as a 2nd parameter to copy(), since http protocol does not support file overwriting.
The destination path. If dest is a URL, the copy operation may fail if the wrapper does not support overwriting of existing files.
Source : http://php.net/manual/en/function.copy.php
I am building a web application using ExtJS4 and PHP5. There is a part where I upload a photo and as I was testing it locally, I am able to upload photos properly to a folder in the file directory.
After I deployed the file to our server online, I tested it. At first, I was getting a class finfo not found, at it pointed to my upload.php file and and to the line:
$finfo = new finfo(FILEINFO_MIME_TYPE);
Upon googling the problem, I needed to make sure that my php.ini file allowed file uploads. So what I did was I made my own php.ini file in the server and I copy pasted the contents from the php.ini file located in ../MAMP/conf/php5.5.10/php.ini but I got an error that I'm trying to decode an invalid JSON String. I also tried ../MAMP/bin/php/php5.5.10/conf/php.ini but I still get the same error.
I don't understand what's happening. I think I'm copying the wrong php.ini file to my server. I am using Freehostia and we are not allowed to access the php.ini file and it was advised to create my own php.ini file. However, so far, copy pasting my php.ini file did not work. It may be that I'm constructing the file wrong.
It's the fist time I've deployed a site that required a file upload, usually I just work with database CRUD and that works.
I found a PHP Settings Page in the home page. I set the PHP to 5.5 and made sure it allowed file uploading.
I need help in finishing a Wordpress plugin I'm developing. I'm almost finished, but I am experiencing some problems and I can't figure out why I get the errors. I am posting the link to the plugin so you may download and test. I think it's the best way to discover what is wrong
What does it do?
The plugin lets you select a image and stores the image URL in a custom property.
You can then retrieve this custom property in your template design.
When you install it, it will add two custom metaboxes to POST and PAGE edit screen in the backend. Each custom property has a button for selecting image. When you click this button, a UI Dialog box opens and displays files and folders.
Once you have selected an image and saved the POST / PAGE, you can retrieve the custom property and use the image url in your template design.
Installation
Just dowload the plugin from here: http://stiengenterprises.com/download/wp-filebrowser
Unzip and copy the folder to you/plugin dir, then activate the plugin.
Known issues
1) 404 Not found
When clicking the 'Get image url' button, jQuery triggers jQuery("#fileBrowser").dialog() which then loads 'fileBrowser.php'.
At line one, I have the following code:
require_once($_SERVER['DOCUMENT_ROOT'].'/wp-blog-header.php');
This is what is causing the 404 Not Found error. This line did not cause any troubles in WP v2.9.1.
2) File upload
I've not been able to use jQuery Form Plugin to uplaod files. I would really like to use this for file Upload. I do not want to use Flash.
I have had a go at it, but no luck :( You can see my Stackoverflow ticket here:
Does anyone have a good example / tutorial on how to use jQuery Form Upload?
I would really really appreciate any help you can give me :)
UPDATE
after testing Todd's suggestion, it works on my local installation of WPMU. But I still receive an error message on my web server:
Warning: require_once(WP_HOME/wp-blog-header.php) [function.require-once]:
failed to open stream: No such file or directory in
/home/mysite/wpmu/wp-content/plugins/wp-filebrowser/fileBrowser.php on line 4
Fatal error: require_once() [function.require]:
Failed opening required 'WP_HOME/wp-blog-header.php'
(include_path='.:/usr/local/php5/lib/php:/usr/local/lib/php') in
/home/mysite/wpmu/wp-content/plugins/wp-filebrowser/fileBrowser.php on line 4
Line 4 is require_once(WP_HOME.'/wp-blog-header.php');
404 Problem:
You do not have to use the
$_SERVER['DOCUMENT_ROOT']
In the WordPress wp-config.php there are the following constant:
define('WP_HOME','http://example.com');
Use these instead and that should fix your problem.
require_once(WP_HOME.'/wp-blog-header.php');
File Upload
This should get you pointed in the right direction:
http://ppshein.wordpress.com/2009/05/22/upload-files-with-jquery-ajax-and-php/
Thanks to Pavel Velikiy, I have fixed the 404 problem.
See separate thread here.
The solution was to add header('HTTP/1.1 200 OK') just after require_once.
As for upload part, I'll deal with that later :)
PS. I'm answering my own solution so I can mark it as solved.
I'm going through the O'Reilly book Learning PHP & MySQL 2nd ed. by Michele Davis & Jon Phillips.
I'm stuck on example 11-28. The goal is to upload a picture and move it from /tmp to an uploads folder if it meets certain conditions: file size, type, and whether or not it was uploaded. This is being stored on my home Ubuntu server.
The form is here, and the code is here. Having a hard time getting it to show up.
When I hit the submit button w/o there being a file in the file box, I get the following warning:
Warning: unlink() [function.unlink]: No such file or directory in /home/luna/public_html/learn_php/up_urs.php on line 10
When I submit a file bigger than maxsize I get my error message:
Error. File must be less than 28480 bytes.
When I submit a file of the wrong type I get my error message:
You may only upload .gif & .jpg files.
When I submit a file that's the right type & size I get the following warning and my OK message:
Warning: move_uploaded_file(learn_php/uploads/) [function.move-uploaded-file]: failed to open stream: No such file or directory in /home/luna/public_html/learn_php/up_urs.php on line 21
Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/php4Mhykl' to 'learn_php/uploads/' in /home/luna/public_html/learn_php/up_urs.php on line 21
Thanks for your upload.
What I've tried:
I thought the problem was permissions but changing the directory learn_php to 777 made no difference so I changed it back to 755.
Changing the path from "uploads" to /home/luna/public_html/learn_php/uploads
Using getcwd() before & after the unlink & move_uploaded_file commands but that only told me I was in learn_php...
I tried uncommenting //print_r($_FILES); but that didn't show me anything after pressing submit.
Not sure what to look for now. Thanks for any help :)
The first error you see is because you are trying to unlink a file that doesn't exist on line 10. After you do the is_uploaded_file() check you should do a quick if ( isset($_FILES['upload_file']['tmp_name']) ) before doing the unlink.
The last two warnings are because it seems you don't have the upload directory already created. I don't think move_uploaded_file() will create it for you. So just create that directory and make sure that it has proper permissions to be written to.
As a beginner, I would also recommend checking the return values of these functions so that you don't return 'all good' when things have actually failed for some reason. Start putting in code like if ( !move_uploaded_file($_FILES['upload_file']['tmp_name'], "/path/to/learn_php/uploads/".$_files['upload_file']['name']) ) { $error = "Could not move the file to the uploads directory."; } else { print "All good, thanks for the upload."; exit(); }
See my answer here. That will give you a function to find the current root directory, which you can use as a prefix for file uploads and image manipulation.
Then, before running unlink, do an is_file() check first (and before moving it, you could run it to to ensure it exists in tmp if you are paranoid)
Rather than guessing your code path try working down from the top.
$uploadpath=$_SERVER['DOCUMENT_ROOT'].'\learn_php\uploads\';
I might be wrong, since you didnt post your source, but you are missing a slash in front of a directory, so it may be trying to store it in \learn_php\learn_php\uploads\ which wont exist, since the PHP file is already in that directory, so it is attempting to access a sub directory.
if all else fails, you will probably want to brush up on the docs.
http://php.net/manual/en/features.file-upload.php
Warning: move_uploaded_file()
[function.move-uploaded-file]: Unable
to move '/tmp/php4Mhykl' to
'learn_php/uploads/' in
/home/luna/public_html/learn_php/up_urs.php
on line 21
This is telling you that the folder you are trying to move to (learn_php/uploads/) doesn't exist. Double check that you've created that folder on your server.