Some pages are showing the phpinfo() output (in HTML so not php -i) even though there is no call to phpinfo() in that page.
The pages include a number of files, but i have grep'd the whole directory from base but cannot find any instance of phpinfo() or "phpinfo" etc.
I've also looked at all "shell", "exec" and "eval" that could generate phpinfo somehow but it doesn't show anything.
How could phpinfo() be showing up on these pages?
Note that php -i will output HTML when your SAPI is CGI, even when invoked from the command line.
Still, try to run the file via CLI to see if if gives the same output. Might be Apache autoprepending another file. Check your httpdconf and .htaccess file if the output is different.
If the output is the same, check your php.ini for the directives auto_prepend_file and auto_append_file to see if there is any filenames in there.
Apart from this, no idea. Maybe install XDebug and step through the code to see where it happens.
Related
So my "code ." command doesn't work. I get the error
/usr/local/bin/code2: line 6: python: command not found
/usr/local/bin/code2: line 10: ./MacOS/Electron: No such file or directory
I saw that I just have to change python to python3 in the code file in /usr/local/bin. Except when I change the file, I'm unable to save it with the change. I get all sorts of errors telling me I don't have permission to change it. So then I look up how to change it, and it says to click on get info on the file, and then change the permissions in the sharing and permissions section. But my get info doesn't HAVE a sharing and permissions section!
What do I do?
PS: I realized I can see permissions if I do get info on the whole bin directory. I made it so everyone can read & write. Except I still can't save the altered version of the code file. I still don't know what to do anymore.
Ok I still have no idea how to save an edited version of the code file, but here is how I got around it for now.
brew install python
ln -s /usr/local/bin/python3 /usr/local/bin/python
Now I can use code . but I'm still very upset with my computer for not cooperating with me. 😡
I am trying to upload an image in my PHP program using eclipse, but here i am not able to find php.ini file.
please help for this
thank you
Here is how you can find your php.ini file regardless of what operating system you are using!
First make a new php file called info.php or some other file name, and deploy it to the document folder, with the following code in it:
<?php
echo phpinfo();
?>
Then access that new php page through the web browser (if the server is working right, the URL is something like http://localhost/php.info maybe).
Then it shows a ton of info including the location of the php.info file.
For me it says "Configuration File (php.ini) Path /etc/php5/fpm" since I am using linux.
Also I think in Windows you can use a file find operation to locate your configuration file.
open up your terminal / command line and enter in the following to find your php.ini file
php -i | grep /php.ini
So I have been seeing a lot of this command line stuff to install/update frameworks/modules over the internet but never actually tried to use it. I would just manually copy files.
I am starting to learn how to use Laravel and also trying to learn about all this command line stuff, I downloaded and installed composer and now this is where I'm stuck.
What do I do with a command line like this php artisan bundle:install bob ?? Do I have to copy it in a cmd.exe or copy it in the address bar of my browser.
I cannot find a tutorial which explains just the basic of the basics of using this and am pretty lost.
From the looks of it you're currently using Laravel 3.
I just want to let you know that Laravel 4 is way on it's way and I'd recommend that you have a look at it instead of L3. Here's a link.
As for your question: You need to define the path to your php.exe file.
Open up your start menu and write "Environment". Without the "".
In the first window you'll see a bunch of variables and values. Edit the "path" variable.
Go to the very end of the "value" field. And - if there isn't already one - type a ";". Without the "".
After that paste the path to your php.exe. Just the folder.
I.e:
C:\xampp\php
not
C:\xampp\php\php.exe
And then you're done.
You might have to restart your computer for this to apply though.
On my mac I mounted a shared drive using WebDAV by going to "Finder > Go > Connect to server".
Now, when I try to view the files using TextWranger or TextEdit I can see the PHP code that I want to edit.
However, if I try to use an IDE like NetBeans/Eclipse/TextMate and create a new project with my shared drive as the "Existing sources" folder I cannot see the PHP code.
Instead I see the HTML output of the files as if I were seeing them through a web browser. Also, if I try to view a file that isn't normally accessibility (a command line script) I see the output as if it were called from the command line.
But a weird thing is if I use TextMate to edit a single file from the shared drive I can see the php code I am trying to edit. It just doesn't work as a project.
Any suggestions or solutions on how I can use an IDE to edit files over WebDAV? And why do my IDEs display the content rendered, instead of the actual file on the file system.
I'm not a specialist at all but I seem to remember that WebDAV clients do send GET requests.
If I'm correct your server may not be able to discriminate between HTTP GET and WebDAV GET thus rendering your .php files. Why this would work that way when working with a project and another way while working with individual files is not clear, though.
Do you get rendered files when you add files to your project manually as well?
Due to the fact that we need to integrate the Zend Framework on our project root, and that generating that documentation will be useless and take long time, I would like to generate documentation for all files inside application folder only.
Does anyone know how I can generate documentation for a specific project folder, trough Netbeans 7.0 interface?
Update:
The best I've found so far was to:
Open the terminal window from netbeans, and type:
sudo phpdoc -d public_html/yoursite.dev/application/ -t public_html/yoursite.dev/docs/
Update 2
Let's suppose our Zend library is inside projectrootname/library/Zend we also can try, by going to: Tools > Options > Php > PhpDoc and place the following:
/usr/bin/phpdoc -i library/Zend/ -o HTML:frames:earthli
At least for me, that doesn't seem to work, because, when I try to generate the documentation, I get permission error issues displayed on the output window.
Thanks
The -d/--directory option [1] should be used to highlight the most high-level code directory that you want phpDocumentor to start reading from. If your Zend folder is at or above the level of your application directory, then just using --directory /path/to/application should help you document only your application code.
If your Zend folder is somewhere inside your application (e.g. in your app's ./lib folder), then you can use the -i/--ignore option [2] to tell phpDocumentor about any directories that it will see but should ignore, --ignore *zend*. Just be aware that formatting your ignore value can be tricky, so see the examples in the manual. Also, be aware that as phpDocumentor runs, you will see these ignored folders and files being listed in the output... phpDocumentor "ignores" them by not generating docs for those files. It does, however, still need to parse them, in case those objects are referenced in files that do get documented.
[1] -- http://manual.phpdoc.org/HTMLSmartyConverter/HandS/phpDocumentor/tutorial_phpDocumentor.howto.pkg.html#using.command-line.directory
[2] -- http://manual.phpdoc.org/HTMLSmartyConverter/HandS/phpDocumentor/tutorial_phpDocumentor.howto.pkg.html#using.command-line.ignore