Where is /usr/local/lib on online server - php

I have a server hosted on 000webhost.com
In the file manager there is a public_html folder where I store my website files, but no \usr folder.
Generally I could just access this file through the command line or terminal but this is not the case on this server. Unless there are command line tools that I simply couldnt find (I know it is a linux server);
I ran phpinfo() and the configuration file path was in usr/local/lib but I have no idea how to access that.
Any ideas? Thanks in advance.

Go to http://www.000webhost.com/faq.php look at the section on connecting to MySql. Your solution is likely there.
Here is a synopsis:
If you cannot connect to MySQL server, there could be some causes:
- Incorrect MySQL hostname.
Never use 'localhost' as your MySQL hostname! You can find your MySQL hostname by logging on to members area, entering control panel and clicking on MySQL icon.
- Incorrect MySQL username / password or database name.
You can find / setup MySQL username and database by clicking on MySQL icon from control panel. And you can change MySQL password by clicking on phpMyAdmin icon.
- Database failed to setup.
In a very rare cases MySQL database can fail to setup. To confirm this, please try to enter phpMyAdmin for any database. If you see database there, that means it setup was successful. And if you get access denied error by trying to enter phpMyAdmin, please delete the database and setup the same MySQL database again.
Please note that always you must give about 1 minute for any changes to apply on server.
If you still unable to connect to MySQL you check if it is server or your script problem in this way: if you can enter phpMyAdmin and see you database there, that means everything is working fine on our side. It's a problem with your PHP script.

Related

Database connect not successful TYPO3

I am working for the first time on one hosting with TYPO3, and seems that I can't connect to database during initial setup (first install). My username and passwords are correct, and I can access to database using other methods but i simply can't with TYPO3 install tool. I tried with default hosts (e.g. localhost and default 127.0.0.1) and even socket based connection but nothing.
Any help please?
Best regrads
I had a similar problem on my local development machine. The solution for me was to comment out the skip-networking line in the MySQL server configuration file my.cnf
At first localhost or 127.0.0.1 will be successful as long as the mysql server is located on the same server.
Either you can create an special typo user for the server and bind it to an DB or you can use the default root user. Any other user also migth work depending on the configuration. Here you should check the accessrigths for the user u want TYPO to log in as.
For the password section you have to check if the user needs a password. If not just omit it.
Also try to select an empty but existing database
The connection type is not really relevant cause most of the problems are caused by wrong host,user, password, database settings.

Error connecting to SQL host, PHP Script: PHPVALLEY Microjob Script

I installed the php script and all wen well but the problem is at the final step, when I need to fill the database information, when I field the database information I find that i am getting an error that says "Error connecting to SQL host", so I try and try in different ways but there is no solution, nevertheless, I installed the same script on my localhost and all went well without problems, my Hosting Provider is: Siteground
Filling Database Information Image
Showing the Error Image
You must grant write permissions to the connect.php file for the user who is running the web service for example apache.
Have you ssh access to the server?
If your application cannot connect to the database you should make sure that:
Your application is using the correct MySQL hostname: localhost
Your application is using the correct MySQL database / username /
password.
Don't forget to specify your MySQL username and database with the
prefix yourusername_ in front of its given name. For example, your
cPanel username is siteground and you have named your database
joomla. In this case you have to refer to your database as
siteground_joomla;
Source: https://www.siteground.com/kb/my_script_cannot_connect_to_my_database_/
Another good idea would be to try to use your cPanel username and password for the Database User and Database Password. This will rule out whether you have granted all privileges to your database user.
Also you should change the permissions of your connect.php file to 755, as if you set them to 777, this will cause an internal server error.

PHP - How to get data from database which is in another pc?

A quick question. I have two laptops, installed with WAMP, both using MYSQL.
I tried ping each other -> success
Configure the phpmyadmin -> require and allow ip addresses ->success
View phpmyadmin of another pc typing 192.168.0.*->succes
But when i tried to putting php code on laptop A with '192.168.0.*' as host , it came out an error, saying server not responding, run time error...
Try giving the following line in the mysql configuration file. And make sure the privilege is there for the user.
bind-address=YOUR-SERVER-IP

phpMyAdmin unable to connect to MySQL Server

I have been using xampp 1.7.4 on a local installation php version is 5.3.5 for several years without any problems. I develop Joomla! websites offline and then upload to the server.
My phpMyAdmin stopped working, giving this error message:
phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in your configuration and make sure that they correspond to the information given by the administrator of the MySQL server.
I am a complete dummy with servers and NEVER fiddle with settings I do not fully understand.
Can anyone please advise?
Go inside your phpMyAdmin directory inside XAMPP installation folder. There will be a file called config.inc.php. Inside that file, find this line:
$cfg['Servers'][$i]['password'] = ''; you must make sure that this field has your mysql root password (the one that you set).

Wordpress installation - php and mysql are not talking to each other to access database?

I'm trying to get a wordpress local install working on my Mac.
I've recently set up a database, username and password using the MySQL client as per the instructions in the wordpress codex. That part is ok.
When I go to the local site on my computer I'm prompted by wordpress to set up the wp-config.php file. Putting in the same details that definitely work with the MySQL client returns an error.
Manually updating these details in the 'wp-config-sample.php' file and renaming it as 'wp-config.php' also doesn't work - I'm now greeted with a big bold message: "Error establishing a database connection".
From what I can gather, php and mysql are not communicating with each other properly.
I've changed the apache 2 configuration file found in 'etc/apache2/httpd.conf' and uncommented the line which loads the php5 module: LoadModule php5_module libexec/apache2/libphp5.so
and restarted the apache server. This has still not fixed my problem. I'm stuck on what to do next... help appreciated please!
It's been fixed now.
php was looking in the wrong place for the mysql.sock file, and couldn't communicate with the mysql database, meaning wordpress couldn't be set up.
On the command line I typed
ps aux | grep mysql
to bring up as much info about mysql that I could. From this I saw that the mysql socket on my computer is being used at /tmp/mysql.sock
Meanwhile, in the "wp-config.php" file, I changed the line define('WP_DEBUG', false); to define('WP_DEBUG', true); and refreshed my web browser that was showing my localhost setup. This now said a lot more info than "Error establishing a database connection" - infact I could see that the mysql.sock was not configured correctly at all.
Creating a 'phpinfo.php' file with just the single line of code <?php phpinfo(); ?> was the pivotal turning point for me.
Putting that 'phpinfo.php' file in my localhost directory and then viewing it from my web browser not only definitely confirmed that the mysql.sock file was not configured properly, but it also showed where the configurations were being loaded from on my machine: '/private/etc/php.ini'
The next thing I did was open up the 'php.ini' file in a text editor and doing a quick find and replace to update the correct location of mysql.sock.
Finally, a restart of the local apache server needed to be done to fully update all the new settings that I'd been fiddling about with.
sudo apachectl restart
Now everything works fine!
The Error-Message "Error establishing a database connection" indicates clearly, that the php-script can not establish the connection. This can have one of the following reasons:
Your host in the wp-config.php is not correct.
The mysql-server does not listen on that host
The user you set up in the mysql has no privileges to connect the way you are trying
The firewall blocks the access of the php-script to your mysql-host
Try to connect the database with the same settings of your wordpress using Sequel Pro (or any other GUI to connect a mysql database). If the connection works, the problem 2. and 3. isn't your problem.
Look in your firewall-log to make sure 4. is also not your problem.
If all problems are excluded (even 1. after a final check), try to run something like phpMyAdmin to connect your database, to make sure your php-installation has the needed drivers.

Categories