I am working on plesk php api. I am adding subscription. There is no problem in this actions. When I was calling multiple query at the same time. Second query is make unsuccessful. Server sending 502 gateway error. I think; plesk api dont process multiple task. I want to make hosting creator. My customers will create own hosting on my customer panel. So I need multiple process at the same time. How i solve this problem ?
Let me assume that you are sending an API request from PHP application located on the same server.
During the subscription creation, Plesk creates new configuration files for web services and reloading these services to apply the new configuration. As a result, PHP application fails whilst, for example, Apache is being restarted at the moment.
As half-measures, you may consider setting Apache restart interval in Tools & Settings > Apache Web Server or enabling graceful restart for Apache.
The best and the right way, of course, is to use a separate hosting to send API queries.
Related
New to Laravel, coming from Rails. In Rails you start the server via rails serve and then begin seeing the server logs (http requests, db queries, etc). How do I see this in Laravel? I'm using Valet so I don't have to run any command to start the server.
The server logs, depend on your valet configuration,
See: Laravel Valet logs
However i think you are looking for the laravel logs, that catch most errors, before sending them to the actual server logs
You'll find these at ./storage/logs in your project. If you didn't set up any different logging method.
We're hosting a php website on Azure App Service.
Sometimes it is down and displays this error:
"Has Encountered an Error String Match Failed. String Not Found"
After restarting the App Service it works again. I'm quite sure it has nothing to do with the PHP part of it. Unfortunately I wasn't able to find anything helpful.
Why does it happen and how can we fix it?
Here is what MS Support wrote
The application site content is hosted within Web App Azure App Services are backed by Azure Storage in a durable manner. The application accesses the site contents as file shares to allow for application compatibility and availability. Unfortunately, there have been a few cases in which sites are unable to access their content, due to storage being unavailable via our file servers. The causes for this may include transient storage/network availability blips, file server maintenance (rebooting/OS patching) or even crashes.
Possible "fixes":
Use the Local cache feature.
Upgrade the service plan to premium V2, it is using SSD storage, and have faster speed to read and write.
Using VM to host website.
Ensure Always-on feature is ON and that PHP version is correctly set on the Portal.
Try enabling logging. To do this:
Use Kudu Console and go into D:\home\site\wwwroot
In your .user.ini file, add the following line (you can type touch .user.ini to create the file if it doesn't exist, and don't forget the starting dot on the .user.ini file!):
log_errors = On
Restart your site
Make a few failing requests to get some logging going.
Now, from Kudu Console, go to D:\home\LogFiles and open up (or download) php_errors.log.
At the end, you'll find the most recent entries, which may give clues as to what's going on.
Reference:https://github.com/projectkudu/kudu/wiki/Troubleshooting-PHP-errors
I'd like to run a script (phantomJS) via php exec() or shell_exec(). Everything is working fine on my development system.
I've installed phantomJS on my production server, and have run it successfully from the terminal after logging in via SSH.
But when I run it from PHP via exec() or shell_exec(), I get messages saying:
GLIBCXX_3.xx not found
GLIBC_2.xx not found
The support team at the web hosting provider is saying they don't know how to enable the server to access the script and still maintain security:
We're not familiar with the specifics of it, so we'll either have to
go through with disabling the chroot, but as our supervisor mentioned
this will allow all accounts on the server to account with each other
which is what the chroot prevents.
You can have your own system administrators look at the setup as you
do have root access, and see if they can devise a workaround, but on
our end this is the only thing we can suggest.
They are running CentOS, which is a 64-bit Linux OS.
I have very good experience with this web host up to this time, so I'm hoping there's a way to address this without changing hosts.
I have full root access to the account, so I can configure it in any way necessary.
Can anyone make some suggestions about how I might configure my production server to access phantomJS while maintaining a secure server?
UPDATE
Apparently my app is in a "chrooted environment" without full root access to GLIB on the server. The web host is saying there will be a lack of security if my php user is given full root access.
You have to remove your PhantomJS system call and create an API layer or a service that subscribes an MQ queue and then integrate it with PHP to avoid several problems, including the chroot limitation.
I am developing APIs in node js and have hosted the application on amazon EC2. In a third party API it is required to host a php page on our server and give its public url back to them. Is there another way to host it apart from a LAMP setup? Anything apart from EC2 is also fine but please take into consideration that this is a single page having some logic and nothing else will be there in PHP.
I work with node and php. I would recommend NGINX. It's configuration files are really simple and it's much lighter-weight than apache.
You can simply create a redirect/rewrite directive in NGINX that will pass your php page to the node server instead and be done. For this usecase, you wouldn't actually even need to install or configure the PHP backend.
http://nginx.org/en/docs/beginners_guide.html#proxy
You might also check AWS domain management tools (AWS Route 53). There may be a way to directly rewrite the incoming PHP request to go to your node app instead without installing any webserver on your EC2.
Yes, there are other web-servers available apart from apache: For instance Nginx plus or Lighttpd, both are fine and lightweight alternatives to host your PHP files on EC2.
Though, it's not clear to me why don't you like the LAMP setup. Maybe Apache+PHP, without MySQL, would be enough for you?
What is the best way to communicate between a shared hosted PHP site (on GoDaddy) and a Windows service on computer at another site? I would like to build a site that will allow a customer to schedule tasks on their server, and then look at logs of those tasks that have run. The problem is getting the scheduling information from the web site to the server, and then pulling log information from the server back to my web site. I will have access to the server to install a service (not sure what language would be best to build the service).
I’ve thought of two options. I wonder if either of these two options makes sense or if a third option would be better.
Option 1 - Sockets:
My PHP code would use fsockopen and fputs
My Windows service would open a socket and receive the text.
The problem I see is potential firewall difficulties. Also, the two would have to open sockets at the same time.
Option 2 – FTP:
The windows service would periodically (once a minute or so) open an FTP connection to my GoDaddy site and place a file and also check to see if there is a file to pull down.
Any thoughts would be appreciated.
Thanks.