I have a website I uploaded online. It works perfectly fine on XAMPP (localhost), but when online, it seems that functions like INSERTING new users to the DB (to register) do not work online, as well as many other INSERT functions. I gave all privileges on DirectAdmin, but on phpMyAdmin I still get "No Privileges".
Does anybody have a fix? and also, is it the phpMyAdmin blocking me from registering new users, or is the problem something else?
There are a few problems here, the most pressing is the lack of information.
phpMyAdmin runs on a web server, but it looks like you are using XAMPP, which is a pre-rolled solution for users that might not necessarily know how to configure phpMyAdmin in Linux/Mac/Windows, setup their own solution, or want something easy to deploy. There should be a log file you can grab.
I've never used XAMPP, but I have used phpMyAdmin for decades. Setting up using the default settings XAMPP is installed to "C:\XAMPP".
If I browse to that file I see a directory called "apache" and inside that "logs". This file, "error", should contain the error that will help us determine why your server is having issues with permissions.
**
Please send the text from the error file in
"\apache\logs".
**
This might be a bug with XAMPP, phpMyAdmin, your configuration, or something else. Paste the errors from the log file and I will be happy to look at them. I can't solve your problem with the information you have provided, but hopefully this will help point you in the right direction.
Related
I am currently developing a web application using AWS services and it's written in PHP. Previously, I used XAMPP to do the work, but now I use EC2 and RDS (MySQL) of AWS. And I also hosted the web on domain using Route 53 and it is secure with Certificate Manager (HTTPS enabled).
This is how I do my job. Sublime Text to write code, then copy paste the file from local to server using WinSCP. If nothing wrong, the code will instantly reflect in my webpage. However, unlike XAMPP, the ERROR will reflect exactly which line is going wrong. The approach I am using will only show HTTP 500 (Request cannot be handled) within the webpage.
For now, I have to test code by code to find the ERROR and it's a waste of time. So, if I want to view which part is going wrong like XAMPP, how can I do so?
Thank you.
In a production environment, it is recommended to switch off detailed errors so that your implementation details are not exposed. Sounds like this is the problem you're facing with the new setup. You need to enable this in your php.ini file, and you might want to look into your .htaccess as well.
Check out the answer here for a more detailed explanation - How can I make PHP display the error instead of giving me 500 Internal Server Error
Here's a guide on implementing the changes you need - https://stackify.com/display-php-errors/
By default, the Errors logs are stored at /var/log/apache2/error.log. So you can do something like the below to see the apache logs in real-time:
tail -f /var/log/apache2/error.log
I recently started using the Laravel framework and i set up a little workspace for me to work in. I setup a Xubuntu client at home that runs a Apache server from which i program and host my Laravel instance from. Now recently I've run into a little bit of a problem. I was following a tutorial series and everything went fine, the next day however i run into this error http://puu.sh/nh5vQ/8ae11c52ab.png
Both from opening the /var/www/html/test/public directory in apache2 from my webbrowser or from running php artisan and actually hosting the laravel instance.
So the first thing that came to mind was permissions, but the permissions for the public folder are fine, It should be able to read or execute as any program. http://puu.sh/nh5Ho/06e061a056.png
Mostly other posts can reference to a bit of code where they specified the wrong filepath. What i find odd is that when i open my hosted instance of apache server in my webbrowser, where you can technically browse all the files in the hosted directory it is there in the list, but when i click it it pops up with that same error.
I checked if all the files that the server is trying to acces exist, and they do exist and i made no typo's.
I'm going to continue on looking and i shall post the solution as soon as i find one, though I'm hoping you guys have an idea since I've been looking for about 2 days to find a solution.
Thanks for your time
I Decided I'd have to start a new Laravel project to fix this without making a chaoticly configured project.
I'm starting to get crazy with this.
I have to do some modifications to a wordpress website that i didn't create. I have access to the hosting so I downloaded all the files and a copy of the database.
After creating and importing in the local database I went to wp-config.php and change the hosting parametres (user, pass, server,...) for the local ones.
But here comes the troubles. When I change the online server dbXXXX.db.1and1.com to localhost it suddenly stops working and files called index.php won't ever work again
(I get "localhost server not found" error),
even if I change the source folder, or restart MAMP or restart the laptop... The only solution is to unistall MAMP, restart the system and install it again, but when changing the name of the server to localhost it happens again...
Well... If I copy the content of index.php in another file (for example index2.php) and set the parameters to the online server it works again until I change server to localhost.
When I say "it works" means that at least I get "error database connection" from wordpress (due to the online hosting does not allow external requests to its databases).
Can somebody help? Do you need some extra information? Thanks!
MAMP did some crazy this on my PC to, so I decided to switch to WAMP -
http://www.wampserver.com/en/
You may give it a try ?!
Finally I found the error. It's due to the file ".htaccess" that Wordpress (or I don't know who) creates for using permalink and MAC OS X.
When unzipping the web downloaded from the hosting the OS deleted that file because only system files can start with a dot (".htaccess").
I didn't find the solution and just start to work in Windows with BootCamp and all was fine. I was in a hurry to finish this job so I didn't have more time to try new solutions.
So I have not the solution but the source of the problem. Hope this helps someone at least finding the problem and save some time.
I have a joomla GIT repository of my project. We are using wamp and windows 7 as a development environment. This repository works fine on one machine. But when we tried to clone same repository on other two machines, we are facing a strange error.
Error is: Error 0 couldn't connect to host
As shown in screenshot.
All other repositories on those two machines work fine.
There is no error logged in under any of error logs file (apache, php and mysql).
I enabled joomla's error reporting. Searched on Google but, no luck.
Please help.
Thanks.
When you clone your Joomla to another machine, there are several things you need to double check:
Not only the files from the GIT, make sure the database is the same on the other two machines as well (export from the first one, import to 2 other one using phpMyAdmin).
Make sure the configuration.php file on two other machines re-corrected, includes: path to logs, tmp folders; database information (host, username, password, database name).
It should works.
Well, I debugged little bit more and finally found the solution. It was a small issue with missing web service link in one table. We are using com_api for web services. On first machine web service link value in table was local value respective to that machine.
On remaining two machines, we updated this to local value of those respective machines.
And it worked :)
This is not a standard Joomla error - it's either that this error is thrown by an extension or it is a server error.
Try adding a die(); at the beginning of your index.php file and see if it actually dies, if it doesn't, then this is definitely a server error.
If it does die, the use the function: get_included_files() and then make a quick search on all the files included on that page for the sentence "Couldn't connect". You will find the culprit easily this way.
Check your .htaccess file, maybe they have some rule which can not be met. (Rename this file if it exists and see what happening)
But I think that the problem is in the network settings. Errors often come from dns issues or, curl connection restrictions.
Check your DNS records
Check your Curl settings and try to create any Curl request.
Check your .htaccess
I don't think this error related to Joomla , I think it is connection from PHP to Linux, try to change the port of the Linux.
and restart the Apache and try again.
i am using shell_exec to get whois details of a domain. Everything is working fine on localhost but when i am uploading the script on server, it is creating problems. On server, the shell_exec is working partially.
echo "shell_exec('whoami')";
gives me an output.
mac
but when i am using
echo "shell_exec('whois example.com')";
I am getting a blank page
Should i consider using a hosting account with root privilege? If yes then how to deal with security issues?
P.S- i dont know if something like this even exists but i've tested it on localhost and it is running fine on MAMP.
Thanks in advance.
If you do decide to host this script with root privileges, then you should (and I'm sorry) be locked up in a padded cell. That's just mad! You don't need root privileges to run a simple whois command. That's insane!
Hosting as root is about as safe as a nursery, ran by catholic priests, serial killers and crack addicts, who haven't had a fix in three days. Things are going to happen... You can only speculate as to when and how bad it's going to end.
Check using whoami what user is running the script, then check what it's PATH looks like, compare that to where whois actually is, if at all present. If it's not installed, ask your admin to set it up, and give you the rights to use it. If it's installed, try shel_exec('/path/to/bin/whois example.com');
Read up on user rights, and environment variables, (and how to load/manipulate them from a PHP script)