Php continues to stay crashed on server - php

I've been using an Ubuntu server for about 10 months now so there is no problem with the way I set everything up. I guess I had some bad code similar to a while loop with no increasing variable to notify the while loop when to stop. And after I executed the code it did what it normally would do and freeze up until I could refresh it. But this time is different because after, it seems any .php file of mine does not show up correctly on my web browser. I can not log into my website via pulling from my phpmyadmin. I'm also not able to log into phpmyadmin. When I try to log into phpmyadmin it just refreshes the page with no error.
My question is, how can I maybe restart php in my Ubuntu server with out losing all my data in my database?
After searching things up I found another possibility for this to be happening. I believe that my hard drive on my server is full not allowing me to do anything.
How can I delete things from my server if I cannot access my database?

I found a solution to getting access to my database again.
The problem was that I used up pretty much all of the memory space on my virtual machine which was blocking any session at all with php. I now have access back to phpmyadmin
Step 1 -
I cleaned up space on my virtual machine hardrive by typing all these commands:
sudo apt-get autoremove
sudo apt-get clean
sudo apt-get autoclean
Step 2 -
Restart virtual machine

Related

How to fix Gateway Timeout on AWS Lightsail server?

I have created a codeigniter app on a AWS with Lightsail that queries a large amount of data from an old magento database, converts into a new format, and pushes it to my new database.
The app works well and fine on my local machine under localhost, but when deploying to a AWS, I encounter a Gateway Timeout error. I believe this is because my local server is willing to wait longer for a response from another server than my AWS.
Is there any way to solve this error? Or rather, is there any way I can increase the amount of time my AWS is willing to wait for a response from my server database?
I tried this, but no dice:
set_time_limit(0);
error_reporting(E_ALL);
ob_implicit_flush(TRUE);
ob_end_flush();
I also tried this to no avail:
ini_set('max_execution_time', 0);
Both were placed in the constructor for my model. If either of these solutions do work, was that the wrong place to put the code?
EDIT: I should also mention that this is a Bitnami server running in Ubuntu.
For future generations, you need to edit timeout in the php-fpm-apache.conf. This is on the line
<Proxy "unix:/opt/bitnami/php/var/run/www.sock|fcgi://www-fpm" timeout=900>
If you don't know where that is, just use
sudo find / -iname php-fpm-apache.conf
in the console. Mine happened to be located at /opt/bitnami/apache2/conf/
Be sure to restart apache and php-fpm with
sudo /opt/bitnami/ctlscript.sh restart php-fpm
sudo /opt/bitnami/ctlscript.sh restart apache
And you'll be good to go!
In my case, I was seeing my "Remaining CPU burst capacity" graph reach zero.
The solution (found here) was to create a bigger size instance. To do this, create a snapshot, then on the snapshot select "create new instance", and choose a bigger size than I was using.
Then, as quoted from this blog
Once done, go to your static IP and edit it to point to a new instance rather than the old instance.
That fixed it for me.

How to make xampp automatically update the localhost

I honestly don't have a clue what to put here... I have searched all over the web and can't seem to find anything useful :(
I am looking to make a website, but then I would like it to update each time I write something in the notepad (or at least when I save it) so I don't have to manually press F5 in my browser each time.
Does anyone know how to do so?
This is going to refresh your page every 10 seconds or whatever amount of milliseconds you input, but that is usually a bad solution, but it is easy and works! Hope this helps, dont forget to remove or disable it when you are done!
setInterval(function(){location.reload(true);}, 10000);
Prepros solved my problem.
PrePros
Open PHP project folder in Prepros
Goto Server options and Select External Server
Check Use External Server option and paste the Xampp Project Url.
:)
here is a free solution for you
you need to:
First install nodejs from nodejs official website,
Then go to your windows command prompt and install browser-sync by writing the following code npm install -g browser-sync, where npm is node js package manager, -g is for global
Then you open the folder you want browser-sync to follow refresh updates in your terminal or command prompt and write the following code browser-sync start --server --files <files which browser-sync wants to follow and refresh for you> some files like *.html *.css css/*.css *.js dont put commas in between
one thing you need to remember is that you need to write the last command every time you want browser-sync
happy codding :)
You can build a php script which check if your files are updated then you create an infinite loop or a timed loop on the client side to request this script. If it returns true (updated), you reload your page.
Theoricaly, it works but I discourage you to do it. It will consume a lot of cpu and will not be really usefull...

Start PHPmyAdmin from putty - Server is remote

Bit stuck here, I have looked on here, for similar, but cant find what I need.
Have looked at how to start PHPmyAdmin via putty on here.
I have a server, which is on a network. I log into the network via Putty.
The database usual access is for example 10.32.187.100/m . This is how I used to access it before the server reboot.
I have had to restart the server. But I cannot log into the database as I believe I have to turn it on.
As it is not on a local machine I do not know how. It is a linux server, and the location of ‘m’ is /var/www/html
In ‘m’ are the files for phpmyAdmin.
Nothing has been over written. The server had to restart. Hence why I need to start up PHPmyAdmin.
Can I ask how do I turn on PHPmyAdmin via putty I the method I need to use?
try this
sudo service mysql start
sudo service apache2 start

Unable to take snapshot with save command in redis

I have redis installed on vps server and to os is centos. I am accessing the server using ssh (via Putty from windows).
problem i am facing is when i hit save command my database is not taking the snapshot. My dump.rdb file is empty even after i hit save command on cli. I tired changing the default path of the dump.rdb yet it dint work.
also all the keys in the database get deleted automatically
Will be thankful if anyone can help me in this.
Thanks in advance.

Cannot Access PHPMyAdmin on Windows LAMP Stack

I installed LAMP on my linux laptop one month ago and it was still working fine. But then recently I can't access phpmyadmin. It always pops up this error:
Error during session start; please check your PHP and/or webserver log file and configure your PHP installation properly. Also ensure that cookies are enabled in your browser.
I tried clearing the cache and cookies of my Mozilla browser but it still won't work. By the way, I'm new to Linux so I'm having a hard time configuring what might went wrong.
Try giving Read Write permission to the folder
sudo chmod 777 /var/lib/php/session/

Categories