here's the problem:
i have a 3rd party script for my website... i have bought hosting from enom.com (i hope this doesn't offend anyone)
i installed the script and works great, except when i try to import rss feeds from other websites.
it's importing the xml file, except the images. The url path is correct, the image exists....
trying to figure out what is wrong, i installed "wamp" on my computer, installed the script and on localhost from my computer the import xml is working perfect, it downloads and add the picture into database + folder
i assume this is a hosting issue, and i want to fix it, can anyone point me where to look?
the hosting plan is using PHP Support as FastCgi application (php safe mode on)
"Server API CGI/FastCGI"
on localhost i have php support on apache
"Server API Apache 2.0 Handler "
thank you!
the answer is very simple, change the hosting company, or pay attention when you place your order.
It's related to allow_url_fopen setting which caused the problem.
in my case i couldn't modify the php.ini file because this was the hosting company policy...
however php.ini can be "bypassed" or modified for each php file by calling the "ini_set" php function which is available for php4/php5 engines...
here's an example
ini_set("allow_url_fopen", 1);
if (ini_get("allow_url_fopen") == 1) {
echo "allow_url_fopen is ON";
} else {
echo "allow_url_fopen is OFF";
}
print ini_get("allow_url_fopen");
and it didn't work for me, because of the hosting company policy...
it can be also "bypassed" or modified by adding one simple line to .htaccess file
php_value allow_url_fopen On
but again, this wasn't an option for me...
CONCLUSION: pay attention when you purchase hosting packages!!!
As for those who can't understand when you can't paste your code as an example because is under specific license and it also encrypted with ioncube, before you post comments sit back and think before you act / or simply do something else...
Related
I have a web app built with angular and PHP that has been established and running since 2016. There is a file upload feature that will upload a file from client-side app to a directory on the server. I noticed the upload is no longer working. Nothing has changed on our end with the configuration of server/hosting or front-end application. The directory still exists and can successfully list files from the front. I get an internal server error when trying to upload with the code below. Very simple example and nothing to indicate this code no longer works. I have file-uploads = on in the php.ini file. It is hosted on GoDaddy. I have checked the error logs and can see that the request is failing but with no detail. Is anyone aware of what may be causing this? I can provide more detail, if thought necessary.
<?php
$target = '../images/attorney_photos/'.$_FILES['file']['name'];
move_uploaded_file($_FILES['file']['tmp_name'], $target);
print('/assets/images/attorney_photos/'.$_FILES['file']['name']);
?>
If your file upload is on then check for
upload_max_filesize
and
post_max_size
in your php.ini file and also if you want to upload more than a specific limit each request, then check
max_file_uploads
to be more than files you want upload.
Also it's better to use a tested library for upload your files. you can search for codeguy/upload in packagist and install it with composer for advanced usage or if you no need lots of options you can download this file from github that is so simple, easy to use and well written.
I hope this helps :)
login to plesk administrator panel then goto Domain->Website->PHP Settings
Change upload_max_filesize from "2MB" to "16MB"
Save and try uploading again.
I've just moved my site from local (xamp on my windows) to AlterVista.
I developed the site with Joomla. In local all okay. When I upload my site it works but I can no longer access to the Joomla control panel with the default/administrator next URL site.
Though, more details could help in detecting the problem but please check these if you've not so far:
Path to the temp and logs folders in [Joomla! Root]/configuration.php.
If you've renamed htaccess.txt, check if .htaccess is all set on the server. Sometimes, your operating system doesn't transfer hidden files and .htaccess can be a hidden file, depending to your OS settings.
Call an inner admin page to test if the admin folder is responding. Something like: domain.com/administrator/index.php?option=com_content.
Via FTP or Host's file manager check if all files are transferred completely.
Clear all of your web browser's cache and retry.
In addition,
I transferred a Joomla! (new version) last week and faced to this. So, it also can be a Joomla! bug.
I have solved my problem. Also in the configurazione.php there was a linea, the " public $force_ssl = '0' " that was setted to 1. Also my /administrator/index.php was asking to my a certificate to log in... I had only to set this value to 0 to resolv my "TOO MANY REDIRECTS" problem...
Thanks for time! I Hope this post Will bè helpfull for someone.
This is my first time I use Filezilla and ftp. I uploaded my files.php. After I entered the hostname on address bar, I could see which files I had uploaded.
The interesting part comes here: When I clicked on index.php to view, It displayed only the html parts.
When I opened page source code, I saw that my php was commented, like this:
From what I had originally written:
<?php include '/includes/php/menu.php'; ?>
it became:
<!--?php include '/includes/php/menu.php'; ?-->
If anyone could help me I would appreciate it. Does any of the above has anything to do with host properties? From what I read, it supported php.
Your host may support php, but that does not mean that PHP is enabled. You can perform a very simple test to find out.
Create a file named test.php and drop one line of php in it and save it:
<?php phpinfo(); ?>
Upload the test.php file to the server and point your browser to it. It should output a bunch of information about the web server if PHP is working.
If not, check your host admin (cpanel) to see if you can enable it yourself. If you don't find it, just submit a ticket to have your host enable it.
PS: Remember to delete the test.php from your site as it is not great for security to leave it there.
UPDATE:
It sounds like you don't have Includes module installed. If you are using Apache, make sure the Apache Module mod_include. To check if you have the module installed you should create a file called phpinfo.php and upload to your server root and it should include the following code:
<?php
phpinfo();
?>
Then load phpinfo.php in your browser and mod_include should be included in the section Loaded Modules. It would be highly unusual if it wasn't there, as it is the default to have it installed on most Apache systems. If you are not on an Apache server, you can still follow the above instructions.
You can set the default editor to view/edit files under Settings->File Settings->Filetype Associations. An example using Notepad is below. There is also a box to inherit system filetype associations and I have it checked.
txt C:\Windows\System32\notepad.exe
php C:\Windows\System32\notepad.exe
I wanna thank all for your support. I am rather newbie in PHP and with you advice I have learnt a lot in the process. I have low rep so I can't give good rates to your answers.
The problem consisted in ftp, but later after changing some options in the host everything went OK. I guess working with PHP offline differs from online.
Thanks a lot everyone
I'm trying to download the file https://gdata.youtube.com/feeds/api/users/testuser to a string (this file contains the youtube API details from the user 'testuser'). But when I download it with fopen I just get a blank file. I searched a bit but nothing helped, what could be wrong? I tested the same code with a file from the same server and it worked.
Also, I know it's possible because some sites do exactly what I'm trying to do (such as SocialBlade)
did you try file_get_contents check if you get the file using this..
Try with file_get_contents. Seems more appropriate.
Beware of the allow-url-fopen setting
If you are on a hosting service on a shared server, Chances are high that you can not change the allow-url-fopen configuration since it is in PHP_INI_SYSTEM mode. Ask your hosting service for more information about this.
I'm trying to use Dreamweaver with an existing code base (not WP, Drupal, or Joomla!) in a PHP/MySQL site. I continue to receive "Dynamically related files could not be found because of an internal server error." I've been googling all day and have read plenty of WP-specific solutions, including the thread on this site. I've tried all the methods listed, no luck.
Setup Info
MAMP 2.0.1
Mac OS X 10.6.8
Dreamweaver CS 5.5
Site's local address: /Users/myName/Sites/siteName
Testing server address: /Applications/MAMP/htdocs/siteName
Attempted solutions:
1) added library to site root (/Users/myName/Sites/siteName/library)
2) added library to MAMP root (/Applications/MAMP/library)
3) added include path for both locations to applied php.ini listed in phpinfo
4) set Dreamweaver to use Site Root paths instead of page-relative paths
5) switched back to page relative paths
6) Restart MAMP, reset ports in Preferences to 8888/8889, or 80/3306
7) checked site info to make sure paths are correctly defined
When I insert the following code, or any require function with a relative path, live view and preview in browser display empty pages.
<?php require_once('includes/initialize.php'); ?>
I'm incredibly frustrated. I had been using XAMPP and a plain text editor for previous work and never had an issue with relative paths. Any help would be appreciated.
Answering my own question; bad form, I'm aware.
EDIT:
Adding to previous list of attempted solutions:
8) tried designating the server ports as 8888/8889 and defining server route as http://localhost:8889/mySite/, like setting up a Drupal/WP/Joomla! testing environment.
9) Uninstalled/Reinstalled MAMP, Dreamweaver, disabled the out-of-the-box Apache server included with OS X, the redefined the site in Dreamweaver.
Fix attempt 8 led to packet error discussed here. Fix attempt 9, plus error reporting that hadn't been working, but did now:
// Report all PHP errors (see changelog)
error_reporting(E_ALL);
showed that the testing server was using the local definition to refer to dynamically related files and, even though that should work, it wasn't working.
After reinstall, created new site with "Site > Manage Sites" and defined Local Site Folder in "Site" menu and the Server Folder in the "Server" Menu as the same directory. (/Applications/MAMP/htdocs/mySite)
Refer to the Setup info in the OP to see my system variables; this may be specific to any/all settings. But only identical local definition and server definition solved the problem. I've recreated previous settings to be sure, and different local/server definitions don't work.
This error can happen with Dreamweaver and PHP sites if the contents of the included file make additional dynamic calls using PHP syntax that Dreamweaver doesn't recognize. Without seeing the contents of initialize.php, I can't be 100% sure this is the case but I am pretty sure that DW is not able to parse the code there and figure out what files to get for display.
Problem Dynamically related files that I see a lot of people run into:
Dreamweaver is scanning whatever is in you Local Copy, it should be a the full installation of WordPress. If you're working locally, download everything on your "Testing server" to your "Local view" in the Files panel.
If you're working with two sets of files, your local copy and what is in MAMP's htdocs or on your "Testing server" should be nearly identical, except for what you're working on of coarse. That's the problem I see people have.
If you're working in kind of "pho-FTP" environment.