I have an Ubuntu 16.04 server, there I installed PHP7+Nginx+MySQL. Also I have a web application developed in Laravel 5.1 in which I take some uploaded files (by the user, they content XML) and read them, I use xml_load_file() to do this, in my local environment everything work great!
Then, in the server when I just cloned the project there I noticed than that function was not working, instead it returned this error:
simplexml_load_file(): I/O warning : failed to load external entity "/tmp/phpSFeOBP"
So, I researched and noticed that I had to enable allow_url_fopen in the php.ini file, so I did it and restarted the server using:
sudo systemctl restart php7.0-fpm
And then it started to work great, but, something strange it happening now, every some hours the server gives the error, and I have to be restarting the php7.0-fpm over and over again, and the php.ini file is the same, it's not modified, so I don't really know what is,what should I do or even why is happening.
To be more especific, this is the code that I have in my project to read the file (and the file exist,so it's not the problem):
ini_set('allow_url_fopen', 'on');//I set this to ensure,but nothin happens
$xml = simplexml_load_file($file);
Related
i AM USING A aws lightsail instance with a Bitnami Apache2 Lampstack setup on it.
My issue is I am unable to get php curl enabled. I seem to have a bunch of php.ini files all over the server in diffiferent locations. So I edited all of them removing the ; from the line that read extension=curl. I then restarted the instance. However my php file is still giving me the error saying
caught Exception: Shippo needs the CURL PHP extension.
When I run a phpinfo() I see my path to the ini file is /etc/php/8.0/apache2/php.ini
However when I do a which php command I am giving a path like this /opt/bitnami/php/bin/php
when I do a php -v I am also seeing it say PHP 7.4.27 so my php info file seems to say I am using php7.8 and my CLI feels i am using php7.4 which could be part of my issue.
Any suggestions on how to fix this? my other issue is I am having a hard time getting to the path /etc/php/8.0/apache2/php.ini I simply can not find a folder with 8.0 in it
I am getting a blank screen and nothing in the error logs for a php program I am trying to get up and running (it happens to be yourls). What do I need to do to get error logging enabled or to otherwise get an indicate of why the page is not loading (I know there are multiple postings on this but none of the fixes suggested in this posts seems to generate any output and don't seem to work for this specific implementation)?
I'm running php from this install: php-8.0.0-nts-Win32-vs16-x64.zip
I'm running Apache HTTPD from this install: httpd-2.4.46-o111i-x64-vc15.zip
Turns out this was a behavior of the yourls software I was trying to run. It had a flag that turned error logging/messaging off AND it was not compatable with php 8. I switched to php 7 and switched to the php.ini-development config (by renaming it to php.ini) and I am now seeing error messages (the driver for the database is missing).
I have a working Apache 2.4 website that works with Php 7 pages, on an Ubuntu 18.10 server.
My example is based on:
https://cloud.google.com/bigquery/docs/quickstarts/quickstart-client-libraries#client-libraries-install-php
When I run the page as me from the command line
php filex.php
bigquery works and I can see the data.
When I try and view it from the apache web server the 1st part of the page renders then there is an error and the bigquery part is missing.
Error in /var/log/apache2
PHP fatal error Uncaught Google Cloud Exception
I guessed it was a permissions issue with Apache vs my userid.
I thought Apache might be having difficulty accessing the Bigquery php client files, due to directory permissions.
However, the problem was I had not set the environment variable correctly.
I had looked here:
https://help.ubuntu.com/community/EnvironmentVariables
and set System-wide environment variables
/etc/environment
GOOGLE_APPLICATION_CREDENTIALS="/bigquery/project1/accountdetails-xxxxxxxxxxxx.json"
It was visible when logged in as userx
echo $GOOGLE_APPLICATION_CREDENTIALS
Then I came across
https://medium.com/#william.b/setting-dynamic-environmental-variables-in-apache-from-the-os-1d5c1e2e9e6c
which gave me the solution
nano /etc/apache2/envvars
I added the line to the bottom of the (mainly empty) script
export GOOGLE_APPLICATION_CREDENTIALS="/bigquery/project1/accountdetails-xxxxxxxxxxxx.json"
I restarted the server.
Now the web page works as expected.
===================
Nginx
nginx also needs to be configured to work (Ubuntu 18.10, nginx 1.14.)
from
https://medium.com/#tomahock/passing-system-environment-variables-to-php-fpm-when-using-nginx-a70045370fad
/etc/php/7.2/fpm/pool.d$
edited www.conf
uncomment
;clear_env = no
added line
env[GOOGLE_APPLICATION_CREDENTIALS] = /bigquery/project1/accountdetails-xxxxxxxxxxxx.json
restarted nginx and it worked.
Have been using MAMP Pro for a fair while - version 3 primarily, upgraded to 4 a while ago.
I haven't had any unusual issues at all, but today the Apache service failed to start, telling me to check the error logs. The logs were blank unfortunately... I've made no system configuration changes, no changes to MAMP/MAMP Pro. Shut down my system yesterday, started today, it no longer works...
I've tried numerous suggestions found via Stack Overflow and Google without any success.
Even after completely uninstalling and re-installing MAMP Pro I am unable to get the service to start.
Nothing appears in the logs...
When starting it manually on the command line it comes up with a PHP related error:
$ Applications/MAMP/bin/apache2/bin/apachectl start
httpd: Syntax error on line 135 of /Applications/MAMP/conf/apache/httpd.conf: Cannot load /Applications/MAMP/bin/php/php5.2.17/modules/libphp5.so into server: dlopen(/Applications/MAMP/bin/php/php5.2.17/modules/libphp5.so, 10): image not found
The confusing thing is that I don't have PHP 5.2.17 specified anywhere, at all - according to MAMP Pro it should be using PHP 7.0.12.
If I add PHP 5.2.17 to MAMP using the appropriate MAMP Pro dialogs, Apache still fails to start via the MAMP Pro interface. I can now start it manually from the command line however, but none of my virtual hosts/etc seem to be loaded.
apachectl -V tells me it's using /Applications/MAMP/conf/apache/httpd.conf, but there is nothing in that file that has any reference to any of the configs generated in /Library/Application Support/appsolute/MAMP PRO/conf
It also looks like hosts entries aren't added to /etc/hosts.
Even if I tell /Applications/MAMP/conf/apache/httpd.conf to do nothing but include /Library/Application Support/appsolute/MAMP PRO/conf/httpd.conf (and manually add entries to /etc/hosts) it still doesn't seem to work at all...
I and my colleagues are at a complete loss, especially given it was working yesterday...
Has anyone had any issues like this?
I managed to fix the similar issue you had.
My Apache server was working fine and then following updating to 4.0.6 I experienced similar issues.
There were 2 things I did to fix the issue. I was getting the same error where it couldn't find a php file in 5.2.17. After fixing that by adding 5.2.17 to MAMP I experienced an apache error regarding user permissions.
(22)Invalid argument: getpwuid: couldn't determine user name from uid 4294967295, you probably need to modify the User directive
File > Edit Template > Revert ALL Templates to Default Settings.
Save & restarted the servers and all worked finally and all my hosts had retained as well.
I had previously entered a custom line in my httpd.conf file that for countless versions had copied across fine however it looks like the folder structure had changed and so couldn't locate it causing the unusual error about User permissions. I have since re-entered the custom line with the correct structure and all working fine again.
Hope this helps.
Can somebody pleas help me to figure out MongoDb Service corruption on windows 7.
whenever I reinstalled the service and all using logs correct syntax etc it worked perfectly at that time.
When I restarted my sytem after each reinstall of mongodB service it get stopped working. Don't know what is the issue in service after system restart it stops working with following error in log file
Unable to check for journal files due to: boost::filesystem::basic_directory_iterator constructor: The system cannot find the path specified: "f:\server\mongodb\mongodb-win32-i386-2.2.0\data\db\journal"
Everything all paths I configured Like below:
mongod.exe --install --config f:\server\mongodb\mongodb-win32-i386-2.2.0\conf\mongodb.conf --logpath f:\server\mongodb\mongodb-win32-i386-2.2.0\logs\mongodb.log
Service stops working only after system restart.
You have to make sure that:
1. There is a folder c:\data\db.
2. There was not an unexpected shutdown of your computer.
I solved such a problem by deleting all from c:\data\db :)