Welcome to the nuBuilder Forums!
Register and log in to access exclusive forums and content available only to registered users.
Register and log in to access exclusive forums and content available only to registered users.
View php syntax errors
View php syntax errors
Is there a way to view syntax errors when developing php procedures? I'm sure no one else makes them, but I do and it would be a lot easier to find and fix my problems if the messages were visible in the window.
Re: View php syntax errors
While code checkers are a great idea, they'll probably choke on all the nuBuilder specific code. If I could just my run the nuBuilder code through command line PHP I would.
-
- nuBuilder Team
- Posts: 4292
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 444 times
- Contact:
Re: View php syntax errors
Double-click on the textarea that contains code to open the Ace Editor. Errors will be highlighted.
-
- Posts: 35
- Joined: Mon Dec 31, 2018 10:31 am
Re: View php syntax errors
I don't know if you have access to the server where your PHP is running but in my case, my hosted provider allows me to view the phplog file.
This is where I usually find PHP syntax errors, I can also use the debug command in my PHP procedures to write to that file.
This is where I usually find PHP syntax errors, I can also use the debug command in my PHP procedures to write to that file.
Re: View php syntax errors
The server is sitting right next to me.BoydG wrote: ↑Fri Apr 21, 2023 9:02 pm I don't know if you have access to the server where your PHP is running but in my case, my hosted provider allows me to view the phplog file.
This is where I usually find PHP syntax errors, I can also use the debug command in my PHP procedures to write to that file.

-
- nuBuilder Team
- Posts: 4292
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 444 times
- Contact:
Re: View php syntax errors
By default, PHP error logs are usually stored in the system log directory of Ubuntu. The specific location of the log file may vary depending on the PHP version and configuration.
You can find the PHP log file path by checking the php.ini configuration file or by running the following command in your terminal:
This will display the configuration files parsed by PHP, including the path to the php.ini file.
In most cases, the PHP error log file is named error.log and is located in the /var/log directory. You can view the contents of the PHP error log file by running the following command:
Note that the location and file name of the PHP error log may be different depending on your server configuration, so it's always a good idea to check the PHP configuration files or consult your system administrator.
You can find the PHP log file path by checking the php.ini configuration file or by running the following command in your terminal:
Code: Select all
php --ini
In most cases, the PHP error log file is named error.log and is located in the /var/log directory. You can view the contents of the PHP error log file by running the following command:
Code: Select all
sudo nano /var/log/apache2/error.log
Re: View php syntax errors
Thanks, that's the file I'm using.
The Atlas editor does work well for simple errors (if I can figure out where it is), but goes apoplectic on some code from PHP libraries and then shows nothing but that one error. Still trying a good way to debug PHP as it looks like I'll be doing quite a bit of it.
The Atlas editor does work well for simple errors (if I can figure out where it is), but goes apoplectic on some code from PHP libraries and then shows nothing but that one error. Still trying a good way to debug PHP as it looks like I'll be doing quite a bit of it.
Re: View php syntax errors
I'm bring this up again because I'm doing a lot of PHP work and there has to be a better way. While I did name the thread syntax errors, perhaps that's not really what I wanted. Here's an example when writing a file to disk, the path may be bad while the syntax is perfect. PHP will tell me that info in an error message. Is there a way to show this information in the window the PHP is running in?
-
- nuBuilder Team
- Posts: 4292
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 444 times
- Contact:
Re: View php syntax errors
PHP nuEval() has been improved to catch syntax errors (Update on Github).
Let me know if it works for you.
Let me know if it works for you.